track usage of templatewizard down to class or symbian/qt project level.
authorwpaul
Mon, 30 Aug 2010 20:19:09 -0500
changeset 1923 581f0f8d494b
parent 1922 f463f24c41ab
child 1924 c8f736b04bf4
track usage of templatewizard down to class or symbian/qt project level.
core/com.nokia.carbide.templatewizard/src/com/nokia/carbide/internal/api/templatewizard/ui/TemplateWizard.java
project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/wizards/NewSymbianOSCppClassWizard.java
project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/wizards/NewSymbianOSCppProjectWizard.java
qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/NewQtCppProjectWizard.java
--- a/core/com.nokia.carbide.templatewizard/src/com/nokia/carbide/internal/api/templatewizard/ui/TemplateWizard.java	Mon Aug 30 18:53:35 2010 -0500
+++ b/core/com.nokia.carbide.templatewizard/src/com/nokia/carbide/internal/api/templatewizard/ui/TemplateWizard.java	Mon Aug 30 20:19:09 2010 -0500
@@ -53,8 +53,6 @@
 	private boolean hideFilterCheckbox;
 	private ChooseTemplatePage chooseTemplatePage;
 
-	private static final String CARBIDE_INF_PROJECT_WIZ_FEATURE = "CARBIDE_INF_PROJECT_WIZARD"; //$NON-NLS-1$
-	
 	@Override
 	public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
 		super.init(workbench, currentSelection);
@@ -112,7 +110,10 @@
 		job.setRule(getJobSchedulingRule());
 		job.schedule();
 		
-		FeatureUseTrackerPlugin.getFeatureUseProxy().useFeature(CARBIDE_INF_PROJECT_WIZ_FEATURE);
+		String featureName = getFeatureName();
+		if (featureName != null && !featureName.isEmpty()) {
+			FeatureUseTrackerPlugin.getFeatureUseProxy().useFeature(featureName);
+		}
 		
 	    return true;
 	}
@@ -262,6 +263,8 @@
 	
 	public abstract String getProcessingTitle();
 	
+	public abstract String getFeatureName();
+
 	public void notifyTemplateChanged() {
 		// nothing to do in base class
 	}
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/wizards/NewSymbianOSCppClassWizard.java	Mon Aug 30 18:53:35 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/wizards/NewSymbianOSCppClassWizard.java	Mon Aug 30 20:19:09 2010 -0500
@@ -37,6 +37,7 @@
  */
 public class NewSymbianOSCppClassWizard extends TemplateWizard {
 	
+	private static final String SOS_CLASS_WIZARD_FEATURE = "SOS_CLASS_WIZARD"; //$NON-NLS-1$
 	private static final String ID = "com.nokia.carbide.cpp.project.ui.wizards.NewSymbianOSCppClassWizard"; 
 	private ChooseProjectPage chooseProjectPage;
 	private ClassNameAndLocationPage chooseClassLocationPage;
@@ -109,4 +110,9 @@
 	public String getProcessingTitle() {
 		return Messages.getString("NewSymbianOSCppClassWizard.ProcessTitle"); //$NON-NLS-1$
 	}
+
+	@Override
+	public String getFeatureName() {
+		return SOS_CLASS_WIZARD_FEATURE;
+	}
 }
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/wizards/NewSymbianOSCppProjectWizard.java	Mon Aug 30 18:53:35 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/wizards/NewSymbianOSCppProjectWizard.java	Mon Aug 30 20:19:09 2010 -0500
@@ -42,6 +42,7 @@
  */
 public class NewSymbianOSCppProjectWizard extends TemplateWizard {
 	
+	private static final String SOS_PROJECT_WIZARD_FEATURE = "SOS_PROJECT_WIZARD"; //$NON-NLS-1$
 	private static final String ID = "com.nokia.carbide.cpp.project.ui.wizards.NewSymbianOSCppProjectWizard"; //$NON-NLS-1$
 	protected List<IWizardDataPage> pagesAfterTemplateChoice;
 	protected BuildTargetsPage buildTargetsPage;
@@ -126,4 +127,9 @@
     	newProjectPage.saveDialogSettings();
 		return super.performFinish();
 	}
+
+	@Override
+	public String getFeatureName() {
+		return SOS_PROJECT_WIZARD_FEATURE;
+	}
 }
--- a/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/NewQtCppProjectWizard.java	Mon Aug 30 18:53:35 2010 -0500
+++ b/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/NewQtCppProjectWizard.java	Mon Aug 30 20:19:09 2010 -0500
@@ -26,6 +26,7 @@
 public class NewQtCppProjectWizard extends NewSymbianOSCppProjectWizard {
 	
 	private static final String ID = "com.nokia.carbide.cpp.qt.ui.wizard.NewQtCppProjectWizard"; //$NON-NLS-1$
+	private static final String QT_PROJECT_WIZARD_FEATURE = "QT_PROJECT_WIZARD"; //$NON-NLS-1$
 
 	private QtModulesPage modulesPage;
 	
@@ -53,8 +54,13 @@
 		return pagesAfterTemplateChoice;
 	}
 
-    @Override
+	@Override
 	public String getWizardId() {
 		return ID;
 	}
+
+	@Override
+	public String getFeatureName() {
+		return QT_PROJECT_WIZARD_FEATURE;
+	}
 }