All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 0/8][eclipse-poky] Add target profile quick switch
@ 2013-06-25 15:33 Timo Mueller
  2013-06-25 15:33 ` [PATCHv3 1/8] plugins/sdk.ide: Use an internationalized dialog title Timo Mueller
  2013-06-25 22:07 ` [PATCHv3 0/8][eclipse-poky] Add target profile quick switch Zhang, Jessica
  0 siblings, 2 replies; 12+ messages in thread
From: Timo Mueller @ 2013-06-25 15:33 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

Hi,

in conclusion to the previous discussion, we've agreed that the quick
switch menu will enable the user to select only configured profiles.
An unconfigured project specific profile will be shown as a greyed out
option in the menu.

There also has been a bug where the projects specific settings and one
profile could be marked as selected at the same time. I could only
reproduce by naming the target profile "project-specific" which
collides with the radioParamter used for the menu. This case is
resolved in this patch set. I've additionally merged the two places
where the state of the menu was set so have one consistent place.

In any case, I've added one patch marked as TESTING to enable tracing
in the relevant components. In case the problem prevails, please
enable the tracing for th org.yocto.sdk.ide plugin and send me the
output.

Changes in v3:
- Only grey out project specific profile if not configured.
- Fix Bug where multiple menu item could be selected at the same time

Changes in v2:
Handle error when project specific profile is not configure more
gracefully. Instead of showing an error message the button is now
greyed out.

Patches 01..07 contain the implementation with the greyed out menu
button.

After playing around with the two options discussed in the first patch
series, I started to prefer inserting a different button in the menu
allowing the user to quickly navigate to the project preferences
instead of just greying it out. I've added this in the last patch of
the series, so you can compare yourself.

From original cover letter
<snip>
if a user wants to change the used target profile of a project he
currently has to open the project preferences. This can be tedious if
he has to switch the profile often.

This is a small addition which allows the user to quickly switch the
used target profile of a project. Instead of having to open the
project preferences the user can select the project in the navigator
and then choose the desired target profile from a drop-down menu in
the toolbar or from the project menu.
</snip>

01: Small i18n fix
02..04: Refactoring the project specific utils
05..06: Introduce the target profile toolbar switch
07: Adds the target profile switch to the project menu
08: TESTING: Enalbe tracing to pin down the multi-select problem

Best regards,
Timo

Timo Mueller (8):
  plugins/sdk.ide: Use an internationalized dialog title
  plugins/sdk.ide: Extract project specific util methods
  plugins/sdk.ide: Move project specific util methods
  plugins/sdk.ide: Remove project context from method names
  plugins/sdk.ide: Add command to switch the target profile
  plugins/sdk.ide: Add profile switch menu to the toolbar
  plugins/sdk.ide: Add profile switch menu to the project menu
  TESTING: add tracing for radio menu

 plugins/org.yocto.sdk.ide/.options                 |   2 +
 .../OSGI-INF/l10n/bundle.properties                |   4 +
 plugins/org.yocto.sdk.ide/plugin.xml               | 100 ++++++++-
 .../sdk/ide/ProjectSpecificContributionItem.java   |  69 ++++++
 .../sdk/ide/TargetProfileContributionItem.java     | 139 ++++++++++++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   4 +
 .../src/org/yocto/sdk/ide/YoctoUISetting.java      |   3 +-
 .../sdk/ide/actions/ProfileSwitchHandler.java      | 134 ++++++++++++
 .../natures/YoctoSDKAutotoolsProjectNature.java    |   3 +-
 .../ide/preferences/YoctoSDKPreferencePage.java    |  11 +-
 .../preferences/YoctoSDKProjectPropertyPage.java   | 130 ++---------
 .../sdk/ide/utils/ProjectPreferenceUtils.java      | 240 +++++++++++++++++++++
 .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 118 ----------
 .../ide/wizard/NewYoctoProjectTemplateProcess.java |   3 +-
 14 files changed, 714 insertions(+), 246 deletions(-)
 create mode 100644 plugins/org.yocto.sdk.ide/.options
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java

-- 
1.8.1.4



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCHv3 1/8] plugins/sdk.ide: Use an internationalized dialog title
  2013-06-25 15:33 [PATCHv3 0/8][eclipse-poky] Add target profile quick switch Timo Mueller
@ 2013-06-25 15:33 ` Timo Mueller
  2013-06-25 15:33   ` [PATCHv3 2/8] plugins/sdk.ide: Extract project specific util methods Timo Mueller
  2013-06-25 22:07 ` [PATCHv3 0/8][eclipse-poky] Add target profile quick switch Zhang, Jessica
  1 sibling, 1 reply; 12+ messages in thread
From: Timo Mueller @ 2013-06-25 15:33 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index e5a7897..d192538 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -42,7 +42,6 @@ import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.preferences.PreferenceConstants;
 
 public class YoctoUISetting {
-
 	private static final String ENV_SCRIPT_FILE_PREFIX = "environment-setup-";
 
 	private SelectionListener fSelectionListener;
@@ -375,7 +374,7 @@ public class YoctoUISetting {
 		if ((result != SDKCheckResults.SDK_PASS) && showErrorDialog) {
 			Display display = Display.getCurrent();
 			ErrorDialog.openError(display.getActiveShell(),
-									"Yocto Project Configuration Error",
+									YoctoSDKChecker.SDKCheckRequestFrom.Other.getErrorMessage(),
 									YoctoSDKChecker.getErrorMessage(result, from),
 									new Status(Status.ERROR, YoctoSDKPlugin.PLUGIN_ID, result.getMessage()));
 
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCHv3 2/8] plugins/sdk.ide: Extract project specific util methods
  2013-06-25 15:33 ` [PATCHv3 1/8] plugins/sdk.ide: Use an internationalized dialog title Timo Mueller
@ 2013-06-25 15:33   ` Timo Mueller
  2013-06-25 15:33     ` [PATCHv3 3/8] plugins/sdk.ide: Move " Timo Mueller
  0 siblings, 1 reply; 12+ messages in thread
From: Timo Mueller @ 2013-06-25 15:33 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

Project specific util methods are moved to a separate util class. This
way the general util class will get more concise and other project
specific methods can be move to this new util class later.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../natures/YoctoSDKAutotoolsProjectNature.java    |   3 +-
 .../ide/preferences/YoctoSDKPreferencePage.java    |  11 +-
 .../preferences/YoctoSDKProjectPropertyPage.java   |  13 +-
 .../sdk/ide/utils/ProjectPreferenceUtils.java      | 138 +++++++++++++++++++++
 .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 118 ------------------
 .../ide/wizard/NewYoctoProjectTemplateProcess.java |   3 +-
 6 files changed, 155 insertions(+), 131 deletions(-)
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
index fb53c53..ce80d77 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
@@ -18,6 +18,7 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
 import org.eclipse.core.resources.IProject;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoUIElement;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 
 public class YoctoSDKAutotoolsProjectNature extends YoctoSDKProjectNature {
@@ -35,7 +36,7 @@ public class YoctoSDKAutotoolsProjectNature extends YoctoSDKProjectNature {
 	public static void configureAutotoolsOptions(IProject project) {
 		IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
 		IConfiguration icfg = info.getDefaultConfiguration();
-		YoctoUIElement elem = YoctoSDKUtils.getElemFromProjectEnv(project);
+		YoctoUIElement elem = ProjectPreferenceUtils.getElemFromProjectEnv(project);
 		String sysroot_str = elem.getStrSysrootLoc();
 		String id = icfg.getId();
 		String CFLAGS_str = YoctoSDKUtils.getEnvValue(project, "CFLAGS");
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 211c4f9..e8123e2 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -34,6 +34,7 @@ import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.natures.YoctoSDKProjectNature;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 import org.yocto.sdk.ide.YoctoSDKMessages;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
@@ -240,10 +241,10 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 
 		for (IProject project : yoctoProjects)
 		{
-			YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
+			ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, project);
 			YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(
 											YoctoSDKPlugin.getProfilePreferenceStore(PreferenceConstants.STANDARD_PROFILE_NAME));
-			YoctoSDKUtils.saveElemToProjectEnv(elem, project);
+			ProjectPreferenceUtils.saveElemToProjectEnv(elem, project);
 		}
 	}
 
@@ -254,14 +255,14 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 
 		for (IProject project : yoctoProjects)
 		{
-			YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
+			ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, project);
 		}
 	}
 
 	private void updateProjects(HashSet<IProject> yoctoProjects, YoctoUIElement elem) {
 		for (IProject project : yoctoProjects)
 		{
-			YoctoSDKUtils.saveElemToProjectEnv(elem, project);
+			ProjectPreferenceUtils.saveElemToProjectEnv(elem, project);
 		}
 	}
 
@@ -295,7 +296,7 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 
 	private boolean projectUsesProfile(IProject project, String profile)
 	{
-		YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromProjectPreferences(project);
+		YoctoProfileElement profileElement = ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
 
 		if (!profileElement.getSelectedProfile().equals(profile)) {
 			return false;
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 9f99caf..f075c5b 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -34,6 +34,7 @@ import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.YoctoSDKMessages;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtilsConstants;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
@@ -69,7 +70,7 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 		IProject project = getProject();
 
 		YoctoProfileElement globalProfileElement= YoctoSDKUtils.getProfilesFromDefaultStore();
-		YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromProjectPreferences(project);
+		YoctoProfileElement profileElement = ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
 
 		String selectedProfile = profileElement.getSelectedProfile();
 		if (!globalProfileElement.contains(selectedProfile)) {
@@ -160,14 +161,14 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 			}
 
 			saveUseProjectSpecificOptionToProjectPreferences(project, true);
-			YoctoSDKUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
+			ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
 			saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(), project);
 		} else {
 			saveUseProjectSpecificOptionToProjectPreferences(project, false);
-			YoctoSDKUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
+			ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
 		}
 
-		YoctoSDKUtils.saveElemToProjectEnv(yoctoUISetting.getCurrentInput(), getProject());
+		ProjectPreferenceUtils.saveElemToProjectEnv(yoctoUISetting.getCurrentInput(), getProject());
 
 		return super.performOk();
 	}
@@ -245,7 +246,7 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 		IScopeContext projectScope = new ProjectScope(project);
 		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
 		if (projectNode == null) {
-			return YoctoSDKUtils.getElemFromProjectEnv(project);
+			return ProjectPreferenceUtils.getElemFromProjectEnv(project);
 		}
 
 		YoctoUIElement elem = new YoctoUIElement();
@@ -287,7 +288,7 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 
 	public void switchToProjectSpecificProfile()
 	{
-		YoctoUIElement profileElement = getElemFromProjectPreferences(getProject());
+		YoctoUIElement profileElement = ProjectPreferenceUtils.getElemFromProjectEnv(getProject());
 		yoctoUISetting.setCurrentInput(profileElement);
 	}
 
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java
new file mode 100644
index 0000000..0f84912
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BMW Car IT GmbH.
+ * Copyright (c) 2010 Intel 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:
+ * Intel - initial implementation
+ * BMW Car IT - initial implementation and refactoring
+ *******************************************************************************/
+package org.yocto.sdk.ide.utils;
+
+import java.io.IOException;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.ConsoleOutputStream;
+import org.eclipse.cdt.core.resources.IConsole;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.osgi.service.prefs.BackingStoreException;
+import org.yocto.sdk.ide.YoctoGeneralException;
+import org.yocto.sdk.ide.YoctoProfileElement;
+import org.yocto.sdk.ide.YoctoSDKMessages;
+import org.yocto.sdk.ide.YoctoUIElement;
+import org.yocto.sdk.ide.natures.YoctoSDKAutotoolsProjectNature;
+import org.yocto.sdk.ide.natures.YoctoSDKCMakeProjectNature;
+import org.yocto.sdk.ide.preferences.PreferenceConstants;
+
+public class ProjectPreferenceUtils {
+	private static final String CONSOLE_MESSAGE  = "Menu.SDK.Console.Configure.Message";
+
+	/* Get POKY Preference settings from project's environment */
+	public static YoctoUIElement getElemFromProjectEnv(IProject project) {
+		YoctoUIElement elem = new YoctoUIElement();
+		elem.setStrToolChainRoot(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.TOOLCHAIN_ROOT));
+		elem.setStrTarget(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.TOOLCHAIN_TRIPLET));
+		elem.setStrQemuKernelLoc(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.QEMU_KERNEL));
+		elem.setStrSysrootLoc(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.SYSROOT));
+		elem.setStrQemuOption(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.QEMU_OPTION));
+		String sTemp = YoctoSDKUtils.getEnvValue(project, PreferenceConstants.TARGET_ARCH_INDEX);
+
+		if (!sTemp.isEmpty()) {
+			elem.setIntTargetIndex(Integer.valueOf(sTemp).intValue());
+		}
+
+		if (YoctoSDKUtils.getEnvValue(project, PreferenceConstants.SDK_MODE).equalsIgnoreCase(IPreferenceStore.TRUE)) {
+			elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
+		} else {
+			elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
+		}
+
+		if(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.TARGET_MODE).equalsIgnoreCase(IPreferenceStore.TRUE)) {
+			elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
+		} else {
+			elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
+		}
+
+		return elem;
+	}
+
+	/* Get profiles and selected profile from the project's preference store */
+	public static YoctoProfileElement getProfilesFromProjectPreferences(IProject project) {
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
+
+		if (projectNode == null) {
+			return YoctoSDKUtils.getProfilesFromDefaultStore();
+		}
+
+		String profiles = projectNode.get(PreferenceConstants.PROFILES, "");
+		String selectedProfile = projectNode.get(PreferenceConstants.SELECTED_PROFILE, "");
+
+		return new YoctoProfileElement(profiles, selectedProfile);
+	}
+
+	/* Save POKY Preference settings to project's environment */
+	public static void saveElemToProjectEnv(YoctoUIElement elem, IProject project) {
+		ConsoleOutputStream consoleOutStream = null;
+
+		try {
+			YoctoSDKUtils.setEnvironmentVariables(project, elem);
+			YoctoSDKUtils.createRemoteDebugAndQemuLaunchers(project, elem);
+
+			if (project.hasNature(YoctoSDKAutotoolsProjectNature.YoctoSDK_AUTOTOOLS_NATURE_ID)) {
+				YoctoSDKAutotoolsProjectNature.configureAutotoolsOptions(project);
+			} else if (project.hasNature(YoctoSDKCMakeProjectNature.YoctoSDK_CMAKE_NATURE_ID)) {
+				YoctoSDKCMakeProjectNature.extendProjectEnvironmentForCMake(project);
+			}
+
+			IConsole console = CCorePlugin.getDefault().getConsole("org.yocto.sdk.ide.YoctoConsole");
+			console.start(project);
+			consoleOutStream = console.getOutputStream();
+			String messages = YoctoSDKMessages.getString(CONSOLE_MESSAGE);
+			consoleOutStream.write(messages.getBytes());
+		} catch (CoreException e) {
+			System.out.println(e.getMessage());
+		} catch (IOException e) {
+			System.out.println(e.getMessage());
+		} catch (YoctoGeneralException e) {
+			System.out.println(e.getMessage());
+		} finally {
+			if (consoleOutStream != null) {
+				try {
+					consoleOutStream.flush();
+					consoleOutStream.close();
+				} catch (IOException e) {
+					// ignore
+				}
+			}
+		}
+	}
+
+	/* Save profiles and selected profile to the project's preference store */
+	public static void saveProfilesToProjectPreferences(YoctoProfileElement profileElement, IProject project) {
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectPreferences = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
+
+		if (projectPreferences == null) {
+			return;
+		}
+
+		projectPreferences.put(PreferenceConstants.PROFILES, profileElement.getProfilesAsString());
+		projectPreferences.put(PreferenceConstants.SELECTED_PROFILE, profileElement.getSelectedProfile());
+
+		try {
+			projectPreferences.flush();
+		} catch (BackingStoreException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java
index 99a9884..2ac48f8 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java
@@ -25,34 +25,26 @@ import java.util.Set;
 import java.util.StringTokenizer;
 
 import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.ConsoleOutputStream;
 import org.eclipse.cdt.core.envvar.IContributedEnvironment;
 import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
 import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager;
 import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.resources.IConsole;
 import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
 import org.eclipse.cdt.core.settings.model.ICProjectDescription;
 import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
 import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.ILaunchConfigurationType;
 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.osgi.service.prefs.BackingStoreException;
 import org.yocto.sdk.ide.YoctoGeneralException;
 import org.yocto.sdk.ide.YoctoProfileElement;
-import org.yocto.sdk.ide.YoctoSDKMessages;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoUIElement;
-import org.yocto.sdk.ide.natures.YoctoSDKAutotoolsProjectNature;
 import org.yocto.sdk.ide.natures.YoctoSDKCMakeProjectNature;
 import org.yocto.sdk.ide.natures.YoctoSDKEmptyProjectNature;
 import org.yocto.sdk.ide.preferences.PreferenceConstants;
@@ -61,7 +53,6 @@ public class YoctoSDKUtils {
 
 	private static final String DEFAULT_SYSROOT_PREFIX = "--sysroot=";
 	private static final String LIBTOOL_SYSROOT_PREFIX = "--with-libtool-sysroot=";
-	private static final String CONSOLE_MESSAGE  = "Menu.SDK.Console.Configure.Message";
 
 	private static final String DEFAULT_USR_BIN = "/usr/bin/";
 	private static final String NATIVE_SYSROOT = "OECORE_NATIVE_SYSROOT";
@@ -395,78 +386,6 @@ public class YoctoSDKUtils {
 		return qemu_target;
 	}
 
-	/* Get POKY Preference settings from project's environment */
-	public static YoctoUIElement getElemFromProjectEnv(IProject project)
-	{
-		YoctoUIElement elem = new YoctoUIElement();
-		elem.setStrToolChainRoot(getEnvValue(project, PreferenceConstants.TOOLCHAIN_ROOT));
-		elem.setStrTarget(getEnvValue(project, PreferenceConstants.TOOLCHAIN_TRIPLET));
-		elem.setStrQemuKernelLoc(getEnvValue(project, PreferenceConstants.QEMU_KERNEL));
-		elem.setStrSysrootLoc(getEnvValue(project, PreferenceConstants.SYSROOT));
-		elem.setStrQemuOption(getEnvValue(project, PreferenceConstants.QEMU_OPTION));
-		String sTemp = getEnvValue(project, PreferenceConstants.TARGET_ARCH_INDEX);
-		if (!sTemp.isEmpty())
-			elem.setIntTargetIndex(Integer.valueOf(sTemp).intValue());
-		if (getEnvValue(project, PreferenceConstants.SDK_MODE).equalsIgnoreCase(IPreferenceStore.TRUE))
-		{
-			elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
-		}
-		else
-			elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
-
-		if(getEnvValue(project, PreferenceConstants.TARGET_MODE).equalsIgnoreCase(IPreferenceStore.TRUE))
-			elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
-		else
-			elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
-		return elem;
-	}
-
-	/* Save POKY Preference settings to project's environment */
-	public static void saveElemToProjectEnv(YoctoUIElement elem, IProject project)
-	{
-		ConsoleOutputStream consoleOutStream = null;
-
-		try {
-			setEnvironmentVariables(project, elem);
-			createRemoteDebugAndQemuLaunchers(project, elem);
-
-			if (project.hasNature(YoctoSDKAutotoolsProjectNature.YoctoSDK_AUTOTOOLS_NATURE_ID)) {
-				YoctoSDKAutotoolsProjectNature.configureAutotoolsOptions(project);
-			} else if (project.hasNature(YoctoSDKCMakeProjectNature.YoctoSDK_CMAKE_NATURE_ID)) {
-				YoctoSDKCMakeProjectNature.extendProjectEnvironmentForCMake(project);
-			}
-
-			IConsole console = CCorePlugin.getDefault().getConsole("org.yocto.sdk.ide.YoctoConsole");
-			console.start(project);
-			consoleOutStream = console.getOutputStream();
-			String messages = YoctoSDKMessages.getString(CONSOLE_MESSAGE);
-			consoleOutStream.write(messages.getBytes());
-		}
-		catch (CoreException e)
-		{
-			System.out.println(e.getMessage());
-		}
-		catch (IOException e)
-		{
-			System.out.println(e.getMessage());
-		}
-		catch (YoctoGeneralException e)
-		{
-			System.out.println(e.getMessage());
-		}
-		finally {
-			if (consoleOutStream != null) {
-				try {
-					consoleOutStream.flush();
-					consoleOutStream.close();
-				}
-				catch (IOException e) {
-					// ignore
-				}
-			}
-		}
-	}
-
 	/* Get IDE wide POKY Preference settings from a specific preference store */
 	public static YoctoUIElement getElemFromStore(IPreferenceStore store) {
 		YoctoUIElement elem = new YoctoUIElement();
@@ -520,27 +439,6 @@ public class YoctoSDKUtils {
 		saveProfilesToStore(profileElement, YoctoSDKPlugin.getDefault().getPreferenceStore());
 	}
 
-	/* Save profiles and selected profile to the project's preference store */
-	public static void saveProfilesToProjectPreferences(YoctoProfileElement profileElement, IProject project) {
-		IScopeContext projectScope = new ProjectScope(project);
-		IEclipsePreferences projectPreferences = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
-		if (projectPreferences == null) {
-			return;
-		}
-
-		projectPreferences.put(PreferenceConstants.PROFILES, profileElement.getProfilesAsString());
-		projectPreferences.put(PreferenceConstants.SELECTED_PROFILE, profileElement.getSelectedProfile());
-
-		try
-		{
-			projectPreferences.flush();
-		} catch (BackingStoreException e)
-		{
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-	}
-
 	/* Save profiles and selected profile to a specific preference store */
 	private static void saveProfilesToStore(YoctoProfileElement profileElement, IPreferenceStore store) {
 		store.setValue(PreferenceConstants.PROFILES, profileElement.getProfilesAsString());
@@ -560,20 +458,4 @@ public class YoctoSDKUtils {
 
 		return new YoctoProfileElement(profiles, selectedProfile);
 	}
-
-	/* Get profiles and selected profile from the project's preference store */
-	public static YoctoProfileElement getProfilesFromProjectPreferences(IProject project)
-	{
-		IScopeContext projectScope = new ProjectScope(project);
-		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
-		if (projectNode == null)
-		{
-			return getProfilesFromDefaultStore();
-		}
-
-		String profiles = projectNode.get(PreferenceConstants.PROFILES, "");
-		String selectedProfile = projectNode.get(PreferenceConstants.SELECTED_PROFILE, "");
-
-		return new YoctoProfileElement(profiles, selectedProfile);
-	}
 }
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java
index 3ea7e33..f64043d 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java
@@ -60,6 +60,7 @@ import org.yocto.sdk.ide.natures.YoctoSDKCMakeProjectNature;
 import org.yocto.sdk.ide.natures.YoctoSDKEmptyProjectNature;
 import org.yocto.sdk.ide.natures.YoctoSDKNatureUtils;
 import org.yocto.sdk.ide.natures.YoctoSDKProjectNature;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 
 @SuppressWarnings("restriction")
@@ -205,7 +206,7 @@ public class NewYoctoProjectTemplateProcess extends ProcessRunner {
 		YoctoSDKChecker.checkIfGloballySelectedYoctoProfileIsValid();
 
 		YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromDefaultStore();
-		YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
+		ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, project);
 
 		IPreferenceStore selecteProfileStore = YoctoSDKPlugin.getProfilePreferenceStore(profileElement.getSelectedProfile());
 		YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(selecteProfileStore);
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCHv3 3/8] plugins/sdk.ide: Move project specific util methods
  2013-06-25 15:33   ` [PATCHv3 2/8] plugins/sdk.ide: Extract project specific util methods Timo Mueller
@ 2013-06-25 15:33     ` Timo Mueller
  2013-06-25 15:33       ` [PATCHv3 4/8] plugins/sdk.ide: Remove project context from method names Timo Mueller
  0 siblings, 1 reply; 12+ messages in thread
From: Timo Mueller @ 2013-06-25 15:33 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

Move project specific methods to the new util class to allow public
usage of theses methods.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../preferences/YoctoSDKProjectPropertyPage.java   | 121 ++-------------------
 .../sdk/ide/utils/ProjectPreferenceUtils.java      | 102 +++++++++++++++++
 2 files changed, 109 insertions(+), 114 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index f075c5b..1f82fe1 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -13,12 +13,8 @@
 package org.yocto.sdk.ide.preferences;
 
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
 import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -27,19 +23,17 @@ import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.ui.IWorkbenchPropertyPage;
 import org.eclipse.ui.dialogs.PropertyPage;
-import org.osgi.service.prefs.BackingStoreException;
 import org.yocto.sdk.ide.YoctoProfileElement;
 import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.YoctoSDKMessages;
-import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
-import org.yocto.sdk.ide.utils.YoctoSDKUtils;
-import org.yocto.sdk.ide.utils.YoctoSDKUtilsConstants;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoUIElement;
 import org.yocto.sdk.ide.YoctoUISetting;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
+import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 
 public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 		IWorkbenchPropertyPage {
@@ -79,10 +73,10 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 
 		yoctoProfileSetting = new YoctoProfileSetting(
 				new YoctoProfileElement(globalProfileElement.getProfilesAsString(), selectedProfile), this, false);
-		boolean useProjectSpecificSetting = getUseProjectSpecificOptionFromProjectPreferences(project);
+		boolean useProjectSpecificSetting = ProjectPreferenceUtils.getUseProjectSpecificOptionFromProjectPreferences(project);
 
 		if (useProjectSpecificSetting) {
-			yoctoUISetting = new YoctoUISetting(getElemFromProjectPreferences(project));
+			yoctoUISetting = new YoctoUISetting(ProjectPreferenceUtils.getElemFromProjectPreferences(project));
 		} else {
 			yoctoUISetting = new YoctoUISetting(YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile)));
 		}
@@ -160,11 +154,11 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 				return false;
 			}
 
-			saveUseProjectSpecificOptionToProjectPreferences(project, true);
+			ProjectPreferenceUtils.saveUseProjectSpecificOptionToProjectPreferences(project, true);
 			ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
-			saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(), project);
+			ProjectPreferenceUtils.saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(), project);
 		} else {
-			saveUseProjectSpecificOptionToProjectPreferences(project, false);
+			ProjectPreferenceUtils.saveUseProjectSpecificOptionToProjectPreferences(project, false);
 			ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
 		}
 
@@ -173,107 +167,6 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 		return super.performOk();
 	}
 
-	private void saveUseProjectSpecificOptionToProjectPreferences(IProject project, boolean useProjectSpecificSetting) {
-		IScopeContext projectScope = new ProjectScope(project);
-		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
-		if (projectNode == null) {
-			return;
-		}
-
-		if (useProjectSpecificSetting) {
-			projectNode.put(PreferenceConstants.PROJECT_SPECIFIC_PROFILE, IPreferenceStore.TRUE);
-		} else {
-			projectNode.put(PreferenceConstants.PROJECT_SPECIFIC_PROFILE, IPreferenceStore.FALSE);
-		}
-
-		try {
-			projectNode.flush();
-		} catch (BackingStoreException e) {
-			e.printStackTrace();
-		}
-	}
-
-	private boolean getUseProjectSpecificOptionFromProjectPreferences(IProject project) {
-		IScopeContext projectScope = new ProjectScope(project);
-		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
-		if (projectNode == null) {
-			return false;
-		}
-
-		String useProjectSpecificSettingString = projectNode.get(PreferenceConstants.PROJECT_SPECIFIC_PROFILE, IPreferenceStore.FALSE);
-
-		if (useProjectSpecificSettingString.equals(IPreferenceStore.FALSE)) {
-			return false;
-		}
-		return true;
-	}
-
-	/* Save POKY Preference settings to project's preference store */
-	private void saveElemToProjectPreferences(YoctoUIElement elem, IProject project) {
-		IScopeContext projectScope = new ProjectScope(project);
-		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
-		if (projectNode == null) {
-			return;
-		}
-
-		projectNode.putInt(PreferenceConstants.TARGET_ARCH_INDEX, elem.getIntTargetIndex());
-		if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
-			projectNode.put(PreferenceConstants.SDK_MODE, IPreferenceStore.TRUE);
-		} else {
-			projectNode.put(PreferenceConstants.SDK_MODE, IPreferenceStore.FALSE);
-		}
-		projectNode.put(PreferenceConstants.QEMU_KERNEL, elem.getStrQemuKernelLoc());
-		projectNode.put(PreferenceConstants.QEMU_OPTION, elem.getStrQemuOption());
-		projectNode.put(PreferenceConstants.SYSROOT, elem.getStrSysrootLoc());
-
-		if (elem.getEnumDeviceMode() == YoctoUIElement.DeviceMode.QEMU_MODE) {
-			projectNode.put(PreferenceConstants.TARGET_MODE, IPreferenceStore.TRUE);
-		} else {
-			projectNode.put(PreferenceConstants.TARGET_MODE, IPreferenceStore.FALSE);
-		}
-		projectNode.put(PreferenceConstants.TOOLCHAIN_ROOT, elem.getStrToolChainRoot());
-		projectNode.put(PreferenceConstants.TOOLCHAIN_TRIPLET, elem.getStrTarget());
-
-		try {
-			projectNode.flush();
-		} catch (BackingStoreException e) {
-			e.printStackTrace();
-		}
-	}
-
-	/* Get POKY Preference settings from project's preference store */
-	private YoctoUIElement getElemFromProjectPreferences(IProject project) {
-		IScopeContext projectScope = new ProjectScope(project);
-		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
-		if (projectNode == null) {
-			return ProjectPreferenceUtils.getElemFromProjectEnv(project);
-		}
-
-		YoctoUIElement elem = new YoctoUIElement();
-		elem.setStrToolChainRoot(projectNode.get(PreferenceConstants.TOOLCHAIN_ROOT,""));
-		elem.setStrTarget(projectNode.get(PreferenceConstants.TOOLCHAIN_TRIPLET,""));
-		elem.setStrQemuKernelLoc(projectNode.get(PreferenceConstants.QEMU_KERNEL,""));
-		elem.setStrSysrootLoc(projectNode.get(PreferenceConstants.SYSROOT,""));
-		elem.setStrQemuOption(projectNode.get(PreferenceConstants.QEMU_OPTION,""));
-		String sTemp = projectNode.get(PreferenceConstants.TARGET_ARCH_INDEX,"");
-		if (!sTemp.isEmpty()) {
-			elem.setIntTargetIndex(Integer.valueOf(sTemp).intValue());
-		}
-
-		if (projectNode.get(PreferenceConstants.SDK_MODE,"").equalsIgnoreCase(IPreferenceStore.TRUE)) {
-			elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
-		} else {
-			elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
-		}
-
-		if(projectNode.get(PreferenceConstants.TARGET_MODE,"").equalsIgnoreCase(IPreferenceStore.TRUE)) {
-			elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
-		} else {
-			elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
-		}
-		return elem;
-	}
-
 	private void clearMessages() {
 		setErrorMessage(null);
 		setMessage(null);
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java
index 0f84912..50904c1 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java
@@ -35,6 +35,39 @@ import org.yocto.sdk.ide.preferences.PreferenceConstants;
 public class ProjectPreferenceUtils {
 	private static final String CONSOLE_MESSAGE  = "Menu.SDK.Console.Configure.Message";
 
+	/* Get POKY Preference settings from project's preference store */
+	public static YoctoUIElement getElemFromProjectPreferences(IProject project) {
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
+		if (projectNode == null) {
+			return getElemFromProjectEnv(project);
+		}
+
+		YoctoUIElement elem = new YoctoUIElement();
+		elem.setStrToolChainRoot(projectNode.get(PreferenceConstants.TOOLCHAIN_ROOT,""));
+		elem.setStrTarget(projectNode.get(PreferenceConstants.TOOLCHAIN_TRIPLET,""));
+		elem.setStrQemuKernelLoc(projectNode.get(PreferenceConstants.QEMU_KERNEL,""));
+		elem.setStrSysrootLoc(projectNode.get(PreferenceConstants.SYSROOT,""));
+		elem.setStrQemuOption(projectNode.get(PreferenceConstants.QEMU_OPTION,""));
+		String sTemp = projectNode.get(PreferenceConstants.TARGET_ARCH_INDEX,"");
+		if (!sTemp.isEmpty()) {
+			elem.setIntTargetIndex(Integer.valueOf(sTemp).intValue());
+		}
+
+		if (projectNode.get(PreferenceConstants.SDK_MODE,"").equalsIgnoreCase(IPreferenceStore.TRUE)) {
+			elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
+		} else {
+			elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
+		}
+
+		if(projectNode.get(PreferenceConstants.TARGET_MODE,"").equalsIgnoreCase(IPreferenceStore.TRUE)) {
+			elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
+		} else {
+			elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
+		}
+		return elem;
+	}
+
 	/* Get POKY Preference settings from project's environment */
 	public static YoctoUIElement getElemFromProjectEnv(IProject project) {
 		YoctoUIElement elem = new YoctoUIElement();
@@ -79,6 +112,55 @@ public class ProjectPreferenceUtils {
 		return new YoctoProfileElement(profiles, selectedProfile);
 	}
 
+	public static boolean getUseProjectSpecificOptionFromProjectPreferences(IProject project) {
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
+		if (projectNode == null) {
+			return false;
+		}
+
+		String useProjectSpecificSettingString = projectNode.get(PreferenceConstants.PROJECT_SPECIFIC_PROFILE,
+																	IPreferenceStore.FALSE);
+
+		if (useProjectSpecificSettingString.equals(IPreferenceStore.FALSE)) {
+			return false;
+		}
+
+		return true;
+	}
+
+	/* Save POKY Preference settings to project's preference store */
+	public static void saveElemToProjectPreferences(YoctoUIElement elem, IProject project) {
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
+		if (projectNode == null) {
+			return;
+		}
+
+		projectNode.putInt(PreferenceConstants.TARGET_ARCH_INDEX, elem.getIntTargetIndex());
+		if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
+			projectNode.put(PreferenceConstants.SDK_MODE, IPreferenceStore.TRUE);
+		} else {
+			projectNode.put(PreferenceConstants.SDK_MODE, IPreferenceStore.FALSE);
+		}
+		projectNode.put(PreferenceConstants.QEMU_KERNEL, elem.getStrQemuKernelLoc());
+		projectNode.put(PreferenceConstants.QEMU_OPTION, elem.getStrQemuOption());
+		projectNode.put(PreferenceConstants.SYSROOT, elem.getStrSysrootLoc());
+		if (elem.getEnumDeviceMode() == YoctoUIElement.DeviceMode.QEMU_MODE) {
+			projectNode.put(PreferenceConstants.TARGET_MODE, IPreferenceStore.TRUE);
+		} else {
+			projectNode.put(PreferenceConstants.TARGET_MODE, IPreferenceStore.FALSE);
+		}
+		projectNode.put(PreferenceConstants.TOOLCHAIN_ROOT, elem.getStrToolChainRoot());
+		projectNode.put(PreferenceConstants.TOOLCHAIN_TRIPLET, elem.getStrTarget());
+
+		try {
+			projectNode.flush();
+		} catch (BackingStoreException e) {
+			e.printStackTrace();
+		}
+	}
+
 	/* Save POKY Preference settings to project's environment */
 	public static void saveElemToProjectEnv(YoctoUIElement elem, IProject project) {
 		ConsoleOutputStream consoleOutStream = null;
@@ -135,4 +217,24 @@ public class ProjectPreferenceUtils {
 			e.printStackTrace();
 		}
 	}
+
+	public static void saveUseProjectSpecificOptionToProjectPreferences(IProject project, boolean useProjectSpecificSetting) {
+		IScopeContext projectScope = new ProjectScope(project);
+		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
+		if (projectNode == null) {
+			return;
+		}
+
+		if (useProjectSpecificSetting) {
+			projectNode.put(PreferenceConstants.PROJECT_SPECIFIC_PROFILE, IPreferenceStore.TRUE);
+		} else {
+			projectNode.put(PreferenceConstants.PROJECT_SPECIFIC_PROFILE, IPreferenceStore.FALSE);
+		}
+
+		try {
+			projectNode.flush();
+		} catch (BackingStoreException e) {
+			e.printStackTrace();
+		}
+	}
 }
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCHv3 4/8] plugins/sdk.ide: Remove project context from method names
  2013-06-25 15:33     ` [PATCHv3 3/8] plugins/sdk.ide: Move " Timo Mueller
@ 2013-06-25 15:33       ` Timo Mueller
  2013-06-25 15:33         ` [PATCHv3 5/8] plugins/sdk.ide: Add command to switch the target profile Timo Mueller
  0 siblings, 1 reply; 12+ messages in thread
From: Timo Mueller @ 2013-06-25 15:33 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

Through the context of the ProjectPreferenceUtil class we can infer
that all methods act on project preferences. Having this context
information duplicated in the method name is not needed anymore and
can be removed to get a cleaner API.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../sdk/ide/preferences/YoctoSDKPreferencePage.java      |  6 +++---
 .../sdk/ide/preferences/YoctoSDKProjectPropertyPage.java | 16 ++++++++--------
 .../org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java  | 12 ++++++------
 .../sdk/ide/wizard/NewYoctoProjectTemplateProcess.java   |  2 +-
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index e8123e2..4e6ca2a 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -241,7 +241,7 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 
 		for (IProject project : yoctoProjects)
 		{
-			ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, project);
+			ProjectPreferenceUtils.saveProfiles(profileElement, project);
 			YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(
 											YoctoSDKPlugin.getProfilePreferenceStore(PreferenceConstants.STANDARD_PROFILE_NAME));
 			ProjectPreferenceUtils.saveElemToProjectEnv(elem, project);
@@ -255,7 +255,7 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 
 		for (IProject project : yoctoProjects)
 		{
-			ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, project);
+			ProjectPreferenceUtils.saveProfiles(profileElement, project);
 		}
 	}
 
@@ -296,7 +296,7 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 
 	private boolean projectUsesProfile(IProject project, String profile)
 	{
-		YoctoProfileElement profileElement = ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
+		YoctoProfileElement profileElement = ProjectPreferenceUtils.getProfiles(project);
 
 		if (!profileElement.getSelectedProfile().equals(profile)) {
 			return false;
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 1f82fe1..f6026ee 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -64,7 +64,7 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 		IProject project = getProject();
 
 		YoctoProfileElement globalProfileElement= YoctoSDKUtils.getProfilesFromDefaultStore();
-		YoctoProfileElement profileElement = ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
+		YoctoProfileElement profileElement = ProjectPreferenceUtils.getProfiles(project);
 
 		String selectedProfile = profileElement.getSelectedProfile();
 		if (!globalProfileElement.contains(selectedProfile)) {
@@ -73,10 +73,10 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 
 		yoctoProfileSetting = new YoctoProfileSetting(
 				new YoctoProfileElement(globalProfileElement.getProfilesAsString(), selectedProfile), this, false);
-		boolean useProjectSpecificSetting = ProjectPreferenceUtils.getUseProjectSpecificOptionFromProjectPreferences(project);
+		boolean useProjectSpecificSetting = ProjectPreferenceUtils.getUseProjectSpecificOption(project);
 
 		if (useProjectSpecificSetting) {
-			yoctoUISetting = new YoctoUISetting(ProjectPreferenceUtils.getElemFromProjectPreferences(project));
+			yoctoUISetting = new YoctoUISetting(ProjectPreferenceUtils.getElem(project));
 		} else {
 			yoctoUISetting = new YoctoUISetting(YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile)));
 		}
@@ -154,12 +154,12 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
 				return false;
 			}
 
-			ProjectPreferenceUtils.saveUseProjectSpecificOptionToProjectPreferences(project, true);
-			ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
-			ProjectPreferenceUtils.saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(), project);
+			ProjectPreferenceUtils.saveUseProjectSpecificOption(project, true);
+			ProjectPreferenceUtils.saveProfiles(yoctoProfileSetting.getCurrentInput(), project);
+			ProjectPreferenceUtils.saveElem(yoctoUISetting.getCurrentInput(), project);
 		} else {
-			ProjectPreferenceUtils.saveUseProjectSpecificOptionToProjectPreferences(project, false);
-			ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
+			ProjectPreferenceUtils.saveUseProjectSpecificOption(project, false);
+			ProjectPreferenceUtils.saveProfiles(yoctoProfileSetting.getCurrentInput(), project);
 		}
 
 		ProjectPreferenceUtils.saveElemToProjectEnv(yoctoUISetting.getCurrentInput(), getProject());
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java
index 50904c1..a06a03c 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java
@@ -36,7 +36,7 @@ public class ProjectPreferenceUtils {
 	private static final String CONSOLE_MESSAGE  = "Menu.SDK.Console.Configure.Message";
 
 	/* Get POKY Preference settings from project's preference store */
-	public static YoctoUIElement getElemFromProjectPreferences(IProject project) {
+	public static YoctoUIElement getElem(IProject project) {
 		IScopeContext projectScope = new ProjectScope(project);
 		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
 		if (projectNode == null) {
@@ -98,7 +98,7 @@ public class ProjectPreferenceUtils {
 	}
 
 	/* Get profiles and selected profile from the project's preference store */
-	public static YoctoProfileElement getProfilesFromProjectPreferences(IProject project) {
+	public static YoctoProfileElement getProfiles(IProject project) {
 		IScopeContext projectScope = new ProjectScope(project);
 		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
 
@@ -112,7 +112,7 @@ public class ProjectPreferenceUtils {
 		return new YoctoProfileElement(profiles, selectedProfile);
 	}
 
-	public static boolean getUseProjectSpecificOptionFromProjectPreferences(IProject project) {
+	public static boolean getUseProjectSpecificOption(IProject project) {
 		IScopeContext projectScope = new ProjectScope(project);
 		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
 		if (projectNode == null) {
@@ -130,7 +130,7 @@ public class ProjectPreferenceUtils {
 	}
 
 	/* Save POKY Preference settings to project's preference store */
-	public static void saveElemToProjectPreferences(YoctoUIElement elem, IProject project) {
+	public static void saveElem(YoctoUIElement elem, IProject project) {
 		IScopeContext projectScope = new ProjectScope(project);
 		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
 		if (projectNode == null) {
@@ -199,7 +199,7 @@ public class ProjectPreferenceUtils {
 	}
 
 	/* Save profiles and selected profile to the project's preference store */
-	public static void saveProfilesToProjectPreferences(YoctoProfileElement profileElement, IProject project) {
+	public static void saveProfiles(YoctoProfileElement profileElement, IProject project) {
 		IScopeContext projectScope = new ProjectScope(project);
 		IEclipsePreferences projectPreferences = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
 
@@ -218,7 +218,7 @@ public class ProjectPreferenceUtils {
 		}
 	}
 
-	public static void saveUseProjectSpecificOptionToProjectPreferences(IProject project, boolean useProjectSpecificSetting) {
+	public static void saveUseProjectSpecificOption(IProject project, boolean useProjectSpecificSetting) {
 		IScopeContext projectScope = new ProjectScope(project);
 		IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
 		if (projectNode == null) {
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java
index f64043d..d8c1232 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java
@@ -206,7 +206,7 @@ public class NewYoctoProjectTemplateProcess extends ProcessRunner {
 		YoctoSDKChecker.checkIfGloballySelectedYoctoProfileIsValid();
 
 		YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromDefaultStore();
-		ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, project);
+		ProjectPreferenceUtils.saveProfiles(profileElement, project);
 
 		IPreferenceStore selecteProfileStore = YoctoSDKPlugin.getProfilePreferenceStore(profileElement.getSelectedProfile());
 		YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(selecteProfileStore);
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCHv3 5/8] plugins/sdk.ide: Add command to switch the target profile
  2013-06-25 15:33       ` [PATCHv3 4/8] plugins/sdk.ide: Remove project context from method names Timo Mueller
@ 2013-06-25 15:33         ` Timo Mueller
  2013-06-25 15:33           ` [PATCHv3 6/8] plugins/sdk.ide: Add profile switch menu to the toolbar Timo Mueller
  0 siblings, 1 reply; 12+ messages in thread
From: Timo Mueller @ 2013-06-25 15:33 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

The command can be used in a radio group to switch the target profile
of a selected project.

Radio items should call this command handing over the name of the
target profile as the command's parameter.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../OSGI-INF/l10n/bundle.properties                |   3 +
 plugins/org.yocto.sdk.ide/plugin.xml               |  18 ++++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   3 +
 .../sdk/ide/actions/ProfileSwitchHandler.java      | 110 +++++++++++++++++++++
 4 files changed, 134 insertions(+)
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java

diff --git a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
index 48eb653..1191af6 100644
--- a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
+++ b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
@@ -6,6 +6,9 @@ extension.name.2 = YoctoSDKCMakeNature
 command.name = ReconfigureYoctoProject
 command.label.0 = Change Yocto Project Settings
 command.mnemonic = C
+command.targetProfileSwitch.name = Change Target Profile
+command.targetProfileSwitch.description = Changes the target profile of a selected project
+command.targetProfileSwitch.parameter.name = Selected Target Profile
 projectType.name.0 = Yocto Project ADT Autotools Project
 projectProperties.label.0 = Yocto Project Settings
 Bundle-Vendor = yoctoproject.org
diff --git a/plugins/org.yocto.sdk.ide/plugin.xml b/plugins/org.yocto.sdk.ide/plugin.xml
index 7ea55c7..62f1297 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -225,5 +225,23 @@
          </filter>
       </page>
    </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            defaultHandler="org.yocto.sdk.ide.actions.ProfileSwitchHandler"
+            description="%command.targetProfileSwitch.description"
+            id="org.yocto.sdk.ide.targetProfile.switch"
+            name="%command.targetProfileSwitch.name">
+         <commandParameter
+               id="org.eclipse.ui.commands.radioStateParameter"
+               name="%command.targetProfileSwitch.parameter.name"
+               optional="false">
+         </commandParameter>
+         <state
+               class="org.eclipse.ui.handlers.RadioState:project-specific"
+               id="org.eclipse.ui.commands.radioState">
+         </state>
+      </command>
+   </extension>
 
 </plugin>
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index 4ff1574..a953d6f 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -89,6 +89,9 @@ Preferences.Profile.Standard.Modification.Message = Standard cross development p
 Preferences.Profile.ProjectSpecific.Title = Use project specific settings
 Preferences.Profile.ProjectSpecific.Group.Title = Project specific settings:
 
+Preferences.Profile.ProjectSpecific.Error.Title = Could not change to project specific target profile
+Preferences.Profile.ProjectSpecific.Error.Message = The project specific target profile is not defined for the project "{0}".\nYou can define it in the project's property page.
+
 Console.SDK.Name = Yocto Project Console
 
 LaunchConfig.Type.Name = org.eclipse.ui.externaltools.ProgramLaunchConfigurationType
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
new file mode 100644
index 0000000..e12597e
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BMW Car IT GmbH.
+ * 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:
+ * BMW Car IT - initial implementation
+ *******************************************************************************/
+package org.yocto.sdk.ide.actions;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.handlers.RadioState;
+import org.yocto.sdk.ide.YoctoProfileElement;
+import org.yocto.sdk.ide.YoctoSDKChecker;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
+import org.yocto.sdk.ide.YoctoSDKMessages;
+import org.yocto.sdk.ide.YoctoSDKPlugin;
+import org.yocto.sdk.ide.YoctoUIElement;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
+import org.yocto.sdk.ide.utils.YoctoSDKUtils;
+
+public class ProfileSwitchHandler extends AbstractHandler {
+	private static final String PROJECT_SPECIFIC_ERROR = "Preferences.Profile.ProjectSpecific.Error.Title";
+	private static final String PROJECT_SPECIFIC_ERROR_MESSAGE = "Preferences.Profile.ProjectSpecific.Error.Message";
+
+	public static final String PROFILE_SWITCH_COMMAND = "org.yocto.sdk.ide.targetProfile.switch"; //$NON-NLS-N$
+	public static final String PROJECT_SPECIFIC_PARAMETER = "##PROJECT_SPECIFIC_PROFILE##"; //$NON-NLS-N$
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		if(HandlerUtil.matchesRadioState(event)) {
+			return null;
+		}
+
+		String currentState = event.getParameter(RadioState.PARAMETER_ID);
+		HandlerUtil.updateRadioState(event.getCommand(), currentState);
+
+		switchProfile(getSelectedProject(event), currentState);
+
+		return null;
+	}
+
+	public IProject getSelectedProject(ExecutionEvent event) {
+		ISelection selection = HandlerUtil.getCurrentSelection(event);
+
+		if (selection instanceof ITreeSelection) {
+			Object selectedItem = ((ITreeSelection) selection).getFirstElement();
+			if (selectedItem instanceof IResource) {
+				return ((IResource) selectedItem).getProject();
+			} else if (selectedItem instanceof ICElement) {
+				ICProject cProject = ((ICElement) selectedItem).getCProject();
+				if (cProject != null) {
+					return cProject.getProject();
+				}
+			} else if (selectedItem instanceof IAdaptable) {
+				Object projectObject = ((IAdaptable) selectedItem).getAdapter(IProject.class);
+				if (projectObject != null && projectObject instanceof IProject) {
+					return ((IProject) projectObject);
+				}
+			}
+		}
+
+		return null;
+	}
+
+	private void switchProfile(IProject project, String selectedProfile) {
+		if (PROJECT_SPECIFIC_PARAMETER.equals(selectedProfile)) {
+			YoctoUIElement yoctoUIElement = ProjectPreferenceUtils.getElem(project);
+			SDKCheckResults result = YoctoSDKChecker.checkYoctoSDK(yoctoUIElement);
+
+			if ((result != SDKCheckResults.SDK_PASS)) {
+				Display display = Display.getCurrent();
+				ErrorDialog.openError(display.getActiveShell(),
+										YoctoSDKMessages.getString(PROJECT_SPECIFIC_ERROR),
+										YoctoSDKMessages.getFormattedString(PROJECT_SPECIFIC_ERROR_MESSAGE,
+															project.getName()),
+										new Status(Status.ERROR, YoctoSDKPlugin.PLUGIN_ID, result.getMessage()));
+				return;
+			}
+
+			ProjectPreferenceUtils.saveElemToProjectEnv(yoctoUIElement, project);
+			ProjectPreferenceUtils.saveUseProjectSpecificOption(project, true);
+		} else {
+			IPreferenceStore store = YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile);
+			YoctoUIElement yoctoUIElement = YoctoSDKUtils.getElemFromStore(store);
+			ProjectPreferenceUtils.saveElemToProjectEnv(yoctoUIElement, project);
+			ProjectPreferenceUtils.saveUseProjectSpecificOption(project, false);
+
+			YoctoProfileElement profileSettings = ProjectPreferenceUtils.getProfiles(project);
+			profileSettings.setSelectedProfile(selectedProfile);
+			ProjectPreferenceUtils.saveProfiles(profileSettings, project);
+		}
+	}
+}
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCHv3 6/8] plugins/sdk.ide: Add profile switch menu to the toolbar
  2013-06-25 15:33         ` [PATCHv3 5/8] plugins/sdk.ide: Add command to switch the target profile Timo Mueller
@ 2013-06-25 15:33           ` Timo Mueller
  2013-06-25 15:33             ` [PATCHv3 7/8] plugins/sdk.ide: Add profile switch menu to the project menu Timo Mueller
  0 siblings, 1 reply; 12+ messages in thread
From: Timo Mueller @ 2013-06-25 15:33 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

If a project with a yocto nature is selected, the toolbar will show a
target profile menu which allows the user to switch the used target
profile of the project.

The content of this menu is dynamically created using the list of
globally defined target profiles. Additionally it will also contain
the project specific profile.

If the project specific profile is not yet defined for the selected
project, the button will be greyed out.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../OSGI-INF/l10n/bundle.properties                |   1 +
 plugins/org.yocto.sdk.ide/plugin.xml               |  57 +++++++++-
 .../sdk/ide/ProjectSpecificContributionItem.java   |  69 +++++++++++
 .../sdk/ide/TargetProfileContributionItem.java     | 126 +++++++++++++++++++++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   1 +
 .../sdk/ide/actions/ProfileSwitchHandler.java      |  26 ++++-
 6 files changed, 278 insertions(+), 2 deletions(-)
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java

diff --git a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
index 1191af6..2031154 100644
--- a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
+++ b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
@@ -7,6 +7,7 @@ command.name = ReconfigureYoctoProject
 command.label.0 = Change Yocto Project Settings
 command.mnemonic = C
 command.targetProfileSwitch.name = Change Target Profile
+command.targetProfileSwitch.label = Target Profiles
 command.targetProfileSwitch.description = Changes the target profile of a selected project
 command.targetProfileSwitch.parameter.name = Selected Target Profile
 projectType.name.0 = Yocto Project ADT Autotools Project
diff --git a/plugins/org.yocto.sdk.ide/plugin.xml b/plugins/org.yocto.sdk.ide/plugin.xml
index 62f1297..aaa0a35 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -81,6 +81,10 @@
             id="org.yocto.sdk.ide.command.reconfigYocto"
             name="%command.name">
       </command>
+      <command
+            id="org.yocto.sdk.ide.command.disabled"
+            name="DisabledCommand">
+      </command>
    </extension>
    <extension
          point="org.eclipse.ui.handlers">
@@ -243,5 +247,56 @@
          </state>
       </command>
    </extension>
-
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            allPopups="true"
+            locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
+         <toolbar
+               id="org.yocto.sdk.ide.profiles.toolbar">
+            <command
+                  commandId="org.yocto.sdk.ide.command.reconfigYocto"
+                  id="org.yocto.sdk.ide.profiles.toolbar.dropdown"
+                  label="%command.targetProfileSwitch.label"
+                  mode="FORCE_TEXT"
+                  style="pulldown"
+                  tooltip="%command.targetProfileSwitch.description">
+               <visibleWhen
+                     checkEnabled="false">
+                  <and>
+	                  <count
+	                        value="1">
+	                  </count>
+	                  <iterate
+	                        operator="and">
+	                     <adapt
+	                           type="org.eclipse.core.resources.IResource">
+	                        <test
+	                              property="org.eclipse.core.resources.projectNature"
+	                              value="org.yocto.sdk.ide.YoctoSDKNature">
+	                        </test>
+	                     </adapt>
+	                  </iterate>
+	               </and>
+               </visibleWhen>
+            </command>
+         </toolbar>
+      </menuContribution>
+      <menuContribution
+            allPopups="false"
+            locationURI="menu:org.yocto.sdk.ide.profiles.toolbar.dropdown">
+         <dynamic
+               class="org.yocto.sdk.ide.ProjectSpecificContributionItem"
+               id="org.yocto.sdk.ide.dynamic.projectSpecific.targetProfile">
+         </dynamic>
+         <separator
+               name="org.yocto.sdk.ide.profiles.separator"
+               visible="true">
+         </separator>
+         <dynamic
+               class="org.yocto.sdk.ide.TargetProfileContributionItem"
+               id="org.yocto.sdk.ide.dynamic.targetProfile">
+         </dynamic>
+      </menuContribution>
+   </extension>
 </plugin>
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
new file mode 100644
index 0000000..c29d278
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BMW Car IT GmbH.
+ * 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:
+ * BMW Car IT - initial implementation
+ *******************************************************************************/
+
+package org.yocto.sdk.ide;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.ui.menus.CommandContributionItem;
+import org.eclipse.ui.menus.CommandContributionItemParameter;
+import org.eclipse.ui.services.IServiceLocator;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
+import org.yocto.sdk.ide.actions.ProfileSwitchHandler;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
+
+public class ProjectSpecificContributionItem extends TargetProfileContributionItem {
+	private static final String PROJECT_SPECIFIC_PROFILE =
+			"Preferences.Profile.ProjectSpecific.Profile.Label"; //$NON-NLS-N$
+	private static final String DISABLED_COMMAND_ID = "org.yocto.sdk.ide.command.disabled"; //$NON-NLS-N$
+
+	private IServiceLocator serviceLocator;
+
+	public ProjectSpecificContributionItem() {}
+
+	public ProjectSpecificContributionItem(String id) {
+		super(id);
+	}
+
+	@Override
+	protected IContributionItem[] getContributionItems() {
+		ArrayList<IContributionItem> items = new ArrayList<IContributionItem>();
+
+		IProject project = getSelectedProject(serviceLocator);
+		YoctoUIElement yoctoUIElement = ProjectPreferenceUtils.getElem(project);
+		SDKCheckResults result = YoctoSDKChecker.checkYoctoSDK(yoctoUIElement);
+
+		if ((result != SDKCheckResults.SDK_PASS)) {
+			CommandContributionItemParameter parameter = new CommandContributionItemParameter(serviceLocator,
+															null,
+															DISABLED_COMMAND_ID,
+															CommandContributionItem.STYLE_PUSH);
+
+			parameter.label = YoctoSDKMessages.getString(PROJECT_SPECIFIC_PROFILE);
+
+			items.add(new CommandContributionItem(parameter));
+		} else {
+			items.add(super.createProfileItem(serviceLocator, ProfileSwitchHandler.PROJECT_SPECIFIC_PARAMETER,
+												YoctoSDKMessages.getString(PROJECT_SPECIFIC_PROFILE)));
+		}
+
+		updateSelection(serviceLocator);
+
+		return items.toArray(new IContributionItem[items.size()]);
+	}
+
+	@Override
+	public void initialize(IServiceLocator serviceLocator) {
+		this.serviceLocator = serviceLocator;
+	}
+}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
new file mode 100644
index 0000000..95d8229
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BMW Car IT GmbH.
+ * 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:
+ * BMW Car IT - initial implementation
+ *******************************************************************************/
+package org.yocto.sdk.ide;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.TreeSet;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.actions.CompoundContributionItem;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.handlers.RadioState;
+import org.eclipse.ui.menus.CommandContributionItem;
+import org.eclipse.ui.menus.CommandContributionItemParameter;
+import org.eclipse.ui.menus.IWorkbenchContribution;
+import org.eclipse.ui.services.IServiceLocator;
+import org.yocto.sdk.ide.actions.ProfileSwitchHandler;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
+import org.yocto.sdk.ide.utils.YoctoSDKUtils;
+
+public class TargetProfileContributionItem extends CompoundContributionItem implements IWorkbenchContribution {
+	private IServiceLocator serviceLocator;
+
+	public TargetProfileContributionItem() {}
+
+	public TargetProfileContributionItem(String id) {
+		super(id);
+	}
+
+	protected CommandContributionItem createProfileItem(IServiceLocator serviceLocator,
+														String parameter, String label) {
+		CommandContributionItemParameter itemParameter;
+		itemParameter = new CommandContributionItemParameter(serviceLocator,
+														null,
+														ProfileSwitchHandler.PROFILE_SWITCH_COMMAND,
+														CommandContributionItem.STYLE_RADIO);
+
+		HashMap<String, String> params = new HashMap<String, String>();
+		params.put(RadioState.PARAMETER_ID, parameter);
+
+		itemParameter.label = label;
+		itemParameter.parameters = params;
+
+		return new CommandContributionItem(itemParameter);
+	}
+
+	@Override
+	protected IContributionItem[] getContributionItems() {
+		TreeSet<String> profiles = YoctoSDKUtils.getProfilesFromDefaultStore().getProfiles();
+		ArrayList<IContributionItem> items = new ArrayList<IContributionItem>();
+
+		for (String profile : profiles) {
+			items.add(createProfileItem(serviceLocator, profile, profile));
+		}
+
+		updateSelection(serviceLocator);
+
+		return items.toArray(new IContributionItem[profiles.size()]);
+	}
+
+	public IProject getSelectedProject(IServiceLocator serviceLocator) {
+		ISelectionService selectionService = (ISelectionService) serviceLocator.getService(ISelectionService.class);
+		ISelection selection = selectionService.getSelection();
+
+		if (selection instanceof ITreeSelection) {
+			Object selectedItem = ((ITreeSelection) selection).getFirstElement();
+			if (selectedItem instanceof IResource) {
+				return ((IResource) selectedItem).getProject();
+			} else if (selectedItem instanceof ICElement) {
+				ICProject cProject = ((ICElement) selectedItem).getCProject();
+				if (cProject != null) {
+					return cProject.getProject();
+				}
+			} else if (selectedItem instanceof IAdaptable) {
+				Object projectObject = ((IAdaptable) selectedItem).getAdapter(IProject.class);
+				if (projectObject != null && projectObject instanceof IProject) {
+					return ((IProject) projectObject);
+				}
+			}
+		}
+
+		return null;
+	}
+
+	@Override
+	public void initialize(IServiceLocator serviceLocator) {
+		this.serviceLocator = serviceLocator;
+	}
+
+	protected void updateSelection(IServiceLocator serviceLocator) {
+		ICommandService commandService = (ICommandService) serviceLocator.getService(ICommandService.class);
+		Command command = commandService.getCommand(ProfileSwitchHandler.PROFILE_SWITCH_COMMAND);
+		IProject project = getSelectedProject(serviceLocator);
+
+		try {
+			if (ProjectPreferenceUtils.getUseProjectSpecificOption(project)) {
+				HandlerUtil.updateRadioState(command, ProfileSwitchHandler.PROJECT_SPECIFIC_PARAMETER);
+				return;
+			}
+
+			String selectedProfile = ProjectPreferenceUtils.getProfiles(project).getSelectedProfile();
+			HandlerUtil.updateRadioState(command, selectedProfile);
+		} catch (ExecutionException e) {
+			// ignore
+		}
+	}
+}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index a953d6f..e3f3308 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -88,6 +88,7 @@ Preferences.Profile.Standard.Modification.Message = Standard cross development p
 
 Preferences.Profile.ProjectSpecific.Title = Use project specific settings
 Preferences.Profile.ProjectSpecific.Group.Title = Project specific settings:
+Preferences.Profile.ProjectSpecific.Profile.Label = Project specific profile
 
 Preferences.Profile.ProjectSpecific.Error.Title = Could not change to project specific target profile
 Preferences.Profile.ProjectSpecific.Error.Message = The project specific target profile is not defined for the project "{0}".\nYou can define it in the project's property page.
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
index e12597e..e3e7e60 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
@@ -10,11 +10,15 @@
  *******************************************************************************/
 package org.yocto.sdk.ide.actions;
 
+import java.util.Map;
+
 import org.eclipse.cdt.core.model.ICElement;
 import org.eclipse.cdt.core.model.ICProject;
 import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.Command;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.State;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IAdaptable;
@@ -24,8 +28,11 @@ import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ITreeSelection;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.commands.IElementUpdater;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.handlers.RadioState;
+import org.eclipse.ui.menus.UIElement;
 import org.yocto.sdk.ide.YoctoProfileElement;
 import org.yocto.sdk.ide.YoctoSDKChecker;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
@@ -35,7 +42,7 @@ import org.yocto.sdk.ide.YoctoUIElement;
 import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 
-public class ProfileSwitchHandler extends AbstractHandler {
+public class ProfileSwitchHandler extends AbstractHandler implements IElementUpdater {
 	private static final String PROJECT_SPECIFIC_ERROR = "Preferences.Profile.ProjectSpecific.Error.Title";
 	private static final String PROJECT_SPECIFIC_ERROR_MESSAGE = "Preferences.Profile.ProjectSpecific.Error.Message";
 
@@ -107,4 +114,21 @@ public class ProfileSwitchHandler extends AbstractHandler {
 			ProjectPreferenceUtils.saveProfiles(profileSettings, project);
 		}
 	}
+
+	/*
+	 * Workaround for BUG 398647 to allow checking radio items
+	 * in a dynamic contribution
+	 *
+	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=398647
+	 */
+	@Override
+	public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
+			ICommandService service = (ICommandService) element.getServiceLocator().getService(ICommandService.class);
+			String state = (String) parameters.get(RadioState.PARAMETER_ID);
+			Command command = service.getCommand(PROFILE_SWITCH_COMMAND);
+			State commandState = command.getState(RadioState.STATE_ID);
+			if (commandState.getValue().equals(state)) {
+				element.setChecked(true);
+			}
+	}
 }
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCHv3 7/8] plugins/sdk.ide: Add profile switch menu to the project menu
  2013-06-25 15:33           ` [PATCHv3 6/8] plugins/sdk.ide: Add profile switch menu to the toolbar Timo Mueller
@ 2013-06-25 15:33             ` Timo Mueller
  2013-06-25 15:33               ` [PATCHv3 8/8] TESTING: add tracing for radio menu Timo Mueller
  0 siblings, 1 reply; 12+ messages in thread
From: Timo Mueller @ 2013-06-25 15:33 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

If a project with a yocto nature is selected, the project menu will
show a target profile menu which allows the user to switch the used
target profile of the project.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 plugins/org.yocto.sdk.ide/plugin.xml | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/plugins/org.yocto.sdk.ide/plugin.xml b/plugins/org.yocto.sdk.ide/plugin.xml
index aaa0a35..c082c3a 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -251,6 +251,15 @@
          point="org.eclipse.ui.menus">
       <menuContribution
             allPopups="true"
+            locationURI="menu:project">
+         <menu
+               id="org.yocto.sdk.ide.profiles.menu"
+               label="%command.targetProfileSwitch.label"
+               tooltip="%command.targetProfileSwitch.description">
+         </menu>
+      </menuContribution>
+      <menuContribution
+            allPopups="true"
             locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
          <toolbar
                id="org.yocto.sdk.ide.profiles.toolbar">
@@ -284,6 +293,22 @@
       </menuContribution>
       <menuContribution
             allPopups="false"
+            locationURI="menu:org.yocto.sdk.ide.profiles.menu">
+         <dynamic
+               class="org.yocto.sdk.ide.ProjectSpecificContributionItem"
+               id="org.yocto.sdk.ide.dynamic.projectSpecific.targetProfile">
+         </dynamic>
+         <separator
+               name="org.yocto.sdk.ide.profiles.separator"
+               visible="true">
+         </separator>
+         <dynamic
+               class="org.yocto.sdk.ide.TargetProfileContributionItem"
+               id="org.yocto.sdk.ide.dynamic.targetProfile">
+         </dynamic>
+      </menuContribution>
+      <menuContribution
+            allPopups="false"
             locationURI="menu:org.yocto.sdk.ide.profiles.toolbar.dropdown">
          <dynamic
                class="org.yocto.sdk.ide.ProjectSpecificContributionItem"
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCHv3 8/8] TESTING: add tracing for radio menu
  2013-06-25 15:33             ` [PATCHv3 7/8] plugins/sdk.ide: Add profile switch menu to the project menu Timo Mueller
@ 2013-06-25 15:33               ` Timo Mueller
  0 siblings, 0 replies; 12+ messages in thread
From: Timo Mueller @ 2013-06-25 15:33 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>


Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 plugins/org.yocto.sdk.ide/.options                        |  2 ++
 .../org/yocto/sdk/ide/TargetProfileContributionItem.java  | 15 ++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 plugins/org.yocto.sdk.ide/.options

diff --git a/plugins/org.yocto.sdk.ide/.options b/plugins/org.yocto.sdk.ide/.options
new file mode 100644
index 0000000..30ba9c2
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/.options
@@ -0,0 +1,2 @@
+org.yocto.sdk.ide/debug=false
+org.yocto.sdk.ide/debug/profileMenu=true
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
index 95d8229..755005d 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
@@ -21,6 +21,7 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.action.IContributionItem;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ITreeSelection;
@@ -38,6 +39,9 @@ import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 
 public class TargetProfileContributionItem extends CompoundContributionItem implements IWorkbenchContribution {
+	private static final boolean DEBUG = YoctoSDKPlugin.getDefault().isDebugging() &&
+								"true".equalsIgnoreCase(Platform.getDebugOption("org.yocto.sdk.ide/debug/profileMenu"));
+
 	private IServiceLocator serviceLocator;
 
 	public TargetProfileContributionItem() {}
@@ -114,13 +118,22 @@ public class TargetProfileContributionItem extends CompoundContributionItem impl
 		try {
 			if (ProjectPreferenceUtils.getUseProjectSpecificOption(project)) {
 				HandlerUtil.updateRadioState(command, ProfileSwitchHandler.PROJECT_SPECIFIC_PARAMETER);
+
+				if (DEBUG)
+					System.out.println("Enabling project specific menu item");
+
 				return;
 			}
 
 			String selectedProfile = ProjectPreferenceUtils.getProfiles(project).getSelectedProfile();
 			HandlerUtil.updateRadioState(command, selectedProfile);
+			if (DEBUG)
+				System.out.println("Enabling menu item of profile: " + selectedProfile);
 		} catch (ExecutionException e) {
-			// ignore
+			if (DEBUG) {
+				System.out.println("An error occurred when trying to enable a menu item");
+				e.printStackTrace();
+			}
 		}
 	}
 }
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCHv3 0/8][eclipse-poky] Add target profile quick switch
  2013-06-25 15:33 [PATCHv3 0/8][eclipse-poky] Add target profile quick switch Timo Mueller
  2013-06-25 15:33 ` [PATCHv3 1/8] plugins/sdk.ide: Use an internationalized dialog title Timo Mueller
@ 2013-06-25 22:07 ` Zhang, Jessica
  2013-06-26  7:02   ` Timo Müller
  1 sibling, 1 reply; 12+ messages in thread
From: Zhang, Jessica @ 2013-06-25 22:07 UTC (permalink / raw)
  To: Timo Mueller, yocto; +Cc: Timo Mueller

Hi Timo,

Now it look much better and also with these patch set, I don't see the multiple selection of radio buttons, so I don't think we need the last patch of the series which enable the debugging.

The only thing that's not clear to me is, after define the project specific settings which is different from profiles. From the menu bar, the project menu, when I toggled between profile and project specific setting, by checking into the project property window, I can see the correct setting is showing.  But if I stayed inside the project property window, if I uncheck my project specific setting box, click on ok.  Then I reopen my project property window, recheck project specific setting box, I noticed that instead of restoring my project specific settings, it copied the prior profile setting.  Which is different behavior than other cases that it always able to restore the defined project specific settings once I defined it.  So is this a bug or intentional behavior?

Except for this case, everything else looks great to me.

Cheers,
Jessica

-----Original Message-----
From: yocto-bounces@yoctoproject.org [mailto:yocto-bounces@yoctoproject.org] On Behalf Of Timo Mueller
Sent: Tuesday, June 25, 2013 8:34 AM
To: yocto@yoctoproject.org
Cc: Timo Mueller
Subject: [yocto] [PATCHv3 0/8][eclipse-poky] Add target profile quick switch

From: Timo Mueller <timo.mueller@bmw-carit.de>

Hi,

in conclusion to the previous discussion, we've agreed that the quick switch menu will enable the user to select only configured profiles.
An unconfigured project specific profile will be shown as a greyed out option in the menu.

There also has been a bug where the projects specific settings and one profile could be marked as selected at the same time. I could only reproduce by naming the target profile "project-specific" which collides with the radioParamter used for the menu. This case is resolved in this patch set. I've additionally merged the two places where the state of the menu was set so have one consistent place.

In any case, I've added one patch marked as TESTING to enable tracing in the relevant components. In case the problem prevails, please enable the tracing for th org.yocto.sdk.ide plugin and send me the output.

Changes in v3:
- Only grey out project specific profile if not configured.
- Fix Bug where multiple menu item could be selected at the same time

Changes in v2:
Handle error when project specific profile is not configure more gracefully. Instead of showing an error message the button is now greyed out.

Patches 01..07 contain the implementation with the greyed out menu button.

After playing around with the two options discussed in the first patch series, I started to prefer inserting a different button in the menu allowing the user to quickly navigate to the project preferences instead of just greying it out. I've added this in the last patch of the series, so you can compare yourself.

From original cover letter
<snip>
if a user wants to change the used target profile of a project he currently has to open the project preferences. This can be tedious if he has to switch the profile often.

This is a small addition which allows the user to quickly switch the used target profile of a project. Instead of having to open the project preferences the user can select the project in the navigator and then choose the desired target profile from a drop-down menu in the toolbar or from the project menu.
</snip>

01: Small i18n fix
02..04: Refactoring the project specific utils
05..06: Introduce the target profile toolbar switch
07: Adds the target profile switch to the project menu
08: TESTING: Enalbe tracing to pin down the multi-select problem

Best regards,
Timo

Timo Mueller (8):
  plugins/sdk.ide: Use an internationalized dialog title
  plugins/sdk.ide: Extract project specific util methods
  plugins/sdk.ide: Move project specific util methods
  plugins/sdk.ide: Remove project context from method names
  plugins/sdk.ide: Add command to switch the target profile
  plugins/sdk.ide: Add profile switch menu to the toolbar
  plugins/sdk.ide: Add profile switch menu to the project menu
  TESTING: add tracing for radio menu

 plugins/org.yocto.sdk.ide/.options                 |   2 +
 .../OSGI-INF/l10n/bundle.properties                |   4 +
 plugins/org.yocto.sdk.ide/plugin.xml               | 100 ++++++++-
 .../sdk/ide/ProjectSpecificContributionItem.java   |  69 ++++++
 .../sdk/ide/TargetProfileContributionItem.java     | 139 ++++++++++++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   4 +
 .../src/org/yocto/sdk/ide/YoctoUISetting.java      |   3 +-
 .../sdk/ide/actions/ProfileSwitchHandler.java      | 134 ++++++++++++
 .../natures/YoctoSDKAutotoolsProjectNature.java    |   3 +-
 .../ide/preferences/YoctoSDKPreferencePage.java    |  11 +-
 .../preferences/YoctoSDKProjectPropertyPage.java   | 130 ++---------
 .../sdk/ide/utils/ProjectPreferenceUtils.java      | 240 +++++++++++++++++++++
 .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 118 ----------
 .../ide/wizard/NewYoctoProjectTemplateProcess.java |   3 +-
 14 files changed, 714 insertions(+), 246 deletions(-)  create mode 100644 plugins/org.yocto.sdk.ide/.options
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
 create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java

--
1.8.1.4

_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCHv3 0/8][eclipse-poky] Add target profile quick switch
  2013-06-25 22:07 ` [PATCHv3 0/8][eclipse-poky] Add target profile quick switch Zhang, Jessica
@ 2013-06-26  7:02   ` Timo Müller
  2013-06-26 16:40     ` Zhang, Jessica
  0 siblings, 1 reply; 12+ messages in thread
From: Timo Müller @ 2013-06-26  7:02 UTC (permalink / raw)
  To: Zhang, Jessica; +Cc: yocto, Timo Mueller

Hi Jessica,

Zhang, Jessica wrote, On 26.06.2013 00:07:
> Hi Timo,
>
> Now it look much better and also with these patch set, I don't see
> the multiple selection of radio buttons, so I don't think we need the
> last patch of the series which enable the debugging.
>
> The only thing that's not clear to me is, after define the project
> specific settings which is different from profiles. From the menu
> bar, the project menu, when I toggled between profile and project
> specific setting, by checking into the project property window, I can
> see the correct setting is showing.  But if I stayed inside the
> project property window, if I uncheck my project specific setting
> box, click on ok.  Then I reopen my project property window, recheck
> project specific setting box, I noticed that instead of restoring my
> project specific settings, it copied the prior profile setting.
> Which is different behavior than other cases that it always able to
> restore the defined project specific settings once I defined it.  So
> is this a bug or intentional behavior?

That is a bug and it's fixed by the patch "plugin/sdk.ide: Pre-populate
project specific profile form". With this patch this patch series needs
some small adjustments (in the refactoring part). Once it is merged,
I'll rework this series and also remove the debugging patch.

>
> Except for this case, everything else looks great to me.
>
> Cheers, Jessica
>
> -----Original Message-----
> From: yocto-bounces@yoctoproject.org [mailto:yocto-bounces@yoctoproject.org] On Behalf Of Timo Mueller
> Sent: Tuesday, June 25, 2013 8:34 AM
> To: yocto@yoctoproject.org
> Cc: Timo Mueller
> Subject: [yocto] [PATCHv3 0/8][eclipse-poky] Add target profile quick switch
>
> From: Timo Mueller <timo.mueller@bmw-carit.de>
>
> Hi,
>
> in conclusion to the previous discussion, we've agreed that the quick switch menu will enable the user to select only configured profiles.
> An unconfigured project specific profile will be shown as a greyed out option in the menu.
>
> There also has been a bug where the projects specific settings and one profile could be marked as selected at the same time. I could only reproduce by naming the target profile "project-specific" which collides with the radioParamter used for the menu. This case is resolved in this patch set. I've additionally merged the two places where the state of the menu was set so have one consistent place.
>
> In any case, I've added one patch marked as TESTING to enable tracing in the relevant components. In case the problem prevails, please enable the tracing for th org.yocto.sdk.ide plugin and send me the output.
>
> Changes in v3:
> - Only grey out project specific profile if not configured.
> - Fix Bug where multiple menu item could be selected at the same time
>
> Changes in v2:
> Handle error when project specific profile is not configure more gracefully. Instead of showing an error message the button is now greyed out.
>
> Patches 01..07 contain the implementation with the greyed out menu button.
>
> After playing around with the two options discussed in the first patch series, I started to prefer inserting a different button in the menu allowing the user to quickly navigate to the project preferences instead of just greying it out. I've added this in the last patch of the series, so you can compare yourself.
>
>  From original cover letter
> <snip>
> if a user wants to change the used target profile of a project he currently has to open the project preferences. This can be tedious if he has to switch the profile often.
>
> This is a small addition which allows the user to quickly switch the used target profile of a project. Instead of having to open the project preferences the user can select the project in the navigator and then choose the desired target profile from a drop-down menu in the toolbar or from the project menu.
> </snip>
>
> 01: Small i18n fix
> 02..04: Refactoring the project specific utils
> 05..06: Introduce the target profile toolbar switch
> 07: Adds the target profile switch to the project menu
> 08: TESTING: Enalbe tracing to pin down the multi-select problem
>
> Best regards,
> Timo
>
> Timo Mueller (8):
>    plugins/sdk.ide: Use an internationalized dialog title
>    plugins/sdk.ide: Extract project specific util methods
>    plugins/sdk.ide: Move project specific util methods
>    plugins/sdk.ide: Remove project context from method names
>    plugins/sdk.ide: Add command to switch the target profile
>    plugins/sdk.ide: Add profile switch menu to the toolbar
>    plugins/sdk.ide: Add profile switch menu to the project menu
>    TESTING: add tracing for radio menu
>
>   plugins/org.yocto.sdk.ide/.options                 |   2 +
>   .../OSGI-INF/l10n/bundle.properties                |   4 +
>   plugins/org.yocto.sdk.ide/plugin.xml               | 100 ++++++++-
>   .../sdk/ide/ProjectSpecificContributionItem.java   |  69 ++++++
>   .../sdk/ide/TargetProfileContributionItem.java     | 139 ++++++++++++
>   .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   4 +
>   .../src/org/yocto/sdk/ide/YoctoUISetting.java      |   3 +-
>   .../sdk/ide/actions/ProfileSwitchHandler.java      | 134 ++++++++++++
>   .../natures/YoctoSDKAutotoolsProjectNature.java    |   3 +-
>   .../ide/preferences/YoctoSDKPreferencePage.java    |  11 +-
>   .../preferences/YoctoSDKProjectPropertyPage.java   | 130 ++---------
>   .../sdk/ide/utils/ProjectPreferenceUtils.java      | 240 +++++++++++++++++++++
>   .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 118 ----------
>   .../ide/wizard/NewYoctoProjectTemplateProcess.java |   3 +-
>   14 files changed, 714 insertions(+), 246 deletions(-)  create mode 100644 plugins/org.yocto.sdk.ide/.options
>   create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
>   create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
>   create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
>   create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java
>
> --
> 1.8.1.4
>
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>

Best regards
Timo


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCHv3 0/8][eclipse-poky] Add target profile quick switch
  2013-06-26  7:02   ` Timo Müller
@ 2013-06-26 16:40     ` Zhang, Jessica
  0 siblings, 0 replies; 12+ messages in thread
From: Zhang, Jessica @ 2013-06-26 16:40 UTC (permalink / raw)
  To: Timo Müller; +Cc: yocto, Timo Mueller

Hi Timo,

That patch is merged to eclipse-poky master.  Please adjust your patch series and resend.

Thanks,
Jessica

-----Original Message-----
From: Timo Müller [mailto:mail@timomueller.eu]
Sent: Wednesday, June 26, 2013 12:03 AM
To: Zhang, Jessica
Cc: yocto@yoctoproject.org; Timo Mueller
Subject: Re: [yocto] [PATCHv3 0/8][eclipse-poky] Add target profile quick switch

Hi Jessica,

Zhang, Jessica wrote, On 26.06.2013 00:07:
> Hi Timo,
>
> Now it look much better and also with these patch set, I don't see the
> multiple selection of radio buttons, so I don't think we need the last
> patch of the series which enable the debugging.
>
> The only thing that's not clear to me is, after define the project
> specific settings which is different from profiles. From the menu bar,
> the project menu, when I toggled between profile and project specific
> setting, by checking into the project property window, I can see the
> correct setting is showing.  But if I stayed inside the project
> property window, if I uncheck my project specific setting box, click
> on ok.  Then I reopen my project property window, recheck project
> specific setting box, I noticed that instead of restoring my project
> specific settings, it copied the prior profile setting.
> Which is different behavior than other cases that it always able to
> restore the defined project specific settings once I defined it.  So
> is this a bug or intentional behavior?

That is a bug and it's fixed by the patch "plugin/sdk.ide: Pre-populate project specific profile form". With this patch this patch series needs some small adjustments (in the refactoring part). Once it is merged, I'll rework this series and also remove the debugging patch.

>
> Except for this case, everything else looks great to me.
>
> Cheers, Jessica
>
> -----Original Message-----
> From: yocto-bounces@yoctoproject.org
> [mailto:yocto-bounces@yoctoproject.org] On Behalf Of Timo Mueller
> Sent: Tuesday, June 25, 2013 8:34 AM
> To: yocto@yoctoproject.org
> Cc: Timo Mueller
> Subject: [yocto] [PATCHv3 0/8][eclipse-poky] Add target profile quick
> switch
>
> From: Timo Mueller <timo.mueller@bmw-carit.de>
>
> Hi,
>
> in conclusion to the previous discussion, we've agreed that the quick switch menu will enable the user to select only configured profiles.
> An unconfigured project specific profile will be shown as a greyed out option in the menu.
>
> There also has been a bug where the projects specific settings and one profile could be marked as selected at the same time. I could only reproduce by naming the target profile "project-specific" which collides with the radioParamter used for the menu. This case is resolved in this patch set. I've additionally merged the two places where the state of the menu was set so have one consistent place.
>
> In any case, I've added one patch marked as TESTING to enable tracing in the relevant components. In case the problem prevails, please enable the tracing for th org.yocto.sdk.ide plugin and send me the output.
>
> Changes in v3:
> - Only grey out project specific profile if not configured.
> - Fix Bug where multiple menu item could be selected at the same time
>
> Changes in v2:
> Handle error when project specific profile is not configure more gracefully. Instead of showing an error message the button is now greyed out.
>
> Patches 01..07 contain the implementation with the greyed out menu button.
>
> After playing around with the two options discussed in the first patch series, I started to prefer inserting a different button in the menu allowing the user to quickly navigate to the project preferences instead of just greying it out. I've added this in the last patch of the series, so you can compare yourself.
>
>  From original cover letter
> <snip>
> if a user wants to change the used target profile of a project he currently has to open the project preferences. This can be tedious if he has to switch the profile often.
>
> This is a small addition which allows the user to quickly switch the used target profile of a project. Instead of having to open the project preferences the user can select the project in the navigator and then choose the desired target profile from a drop-down menu in the toolbar or from the project menu.
> </snip>
>
> 01: Small i18n fix
> 02..04: Refactoring the project specific utils
> 05..06: Introduce the target profile toolbar switch
> 07: Adds the target profile switch to the project menu
> 08: TESTING: Enalbe tracing to pin down the multi-select problem
>
> Best regards,
> Timo
>
> Timo Mueller (8):
>    plugins/sdk.ide: Use an internationalized dialog title
>    plugins/sdk.ide: Extract project specific util methods
>    plugins/sdk.ide: Move project specific util methods
>    plugins/sdk.ide: Remove project context from method names
>    plugins/sdk.ide: Add command to switch the target profile
>    plugins/sdk.ide: Add profile switch menu to the toolbar
>    plugins/sdk.ide: Add profile switch menu to the project menu
>    TESTING: add tracing for radio menu
>
>   plugins/org.yocto.sdk.ide/.options                 |   2 +
>   .../OSGI-INF/l10n/bundle.properties                |   4 +
>   plugins/org.yocto.sdk.ide/plugin.xml               | 100 ++++++++-
>   .../sdk/ide/ProjectSpecificContributionItem.java   |  69 ++++++
>   .../sdk/ide/TargetProfileContributionItem.java     | 139 ++++++++++++
>   .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   4 +
>   .../src/org/yocto/sdk/ide/YoctoUISetting.java      |   3 +-
>   .../sdk/ide/actions/ProfileSwitchHandler.java      | 134 ++++++++++++
>   .../natures/YoctoSDKAutotoolsProjectNature.java    |   3 +-
>   .../ide/preferences/YoctoSDKPreferencePage.java    |  11 +-
>   .../preferences/YoctoSDKProjectPropertyPage.java   | 130 ++---------
>   .../sdk/ide/utils/ProjectPreferenceUtils.java      | 240 +++++++++++++++++++++
>   .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 118 ----------
>   .../ide/wizard/NewYoctoProjectTemplateProcess.java |   3 +-
>   14 files changed, 714 insertions(+), 246 deletions(-)  create mode 100644 plugins/org.yocto.sdk.ide/.options
>   create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
>   create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
>   create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
>   create mode 100644
> plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenc
> eUtils.java
>
> --
> 1.8.1.4
>
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>

Best regards
Timo


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-06-26 16:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-25 15:33 [PATCHv3 0/8][eclipse-poky] Add target profile quick switch Timo Mueller
2013-06-25 15:33 ` [PATCHv3 1/8] plugins/sdk.ide: Use an internationalized dialog title Timo Mueller
2013-06-25 15:33   ` [PATCHv3 2/8] plugins/sdk.ide: Extract project specific util methods Timo Mueller
2013-06-25 15:33     ` [PATCHv3 3/8] plugins/sdk.ide: Move " Timo Mueller
2013-06-25 15:33       ` [PATCHv3 4/8] plugins/sdk.ide: Remove project context from method names Timo Mueller
2013-06-25 15:33         ` [PATCHv3 5/8] plugins/sdk.ide: Add command to switch the target profile Timo Mueller
2013-06-25 15:33           ` [PATCHv3 6/8] plugins/sdk.ide: Add profile switch menu to the toolbar Timo Mueller
2013-06-25 15:33             ` [PATCHv3 7/8] plugins/sdk.ide: Add profile switch menu to the project menu Timo Mueller
2013-06-25 15:33               ` [PATCHv3 8/8] TESTING: add tracing for radio menu Timo Mueller
2013-06-25 22:07 ` [PATCHv3 0/8][eclipse-poky] Add target profile quick switch Zhang, Jessica
2013-06-26  7:02   ` Timo Müller
2013-06-26 16:40     ` Zhang, Jessica

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.