erge
authordadubrow
Tue, 02 Mar 2010 13:32:41 -0600
changeset 1062 75d025937e7e
parent 1061 ceac11190019 (current diff)
parent 1054 e9c3c381af2f (diff)
child 1064 5d70f98a0746
erge
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/BldInfSelectionPage.java	Tue Mar 02 13:31:49 2010 -0600
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/BldInfSelectionPage.java	Tue Mar 02 13:32:41 2010 -0600
@@ -29,6 +29,7 @@
 import org.eclipse.jface.dialogs.IDialogSettings;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Font;
@@ -119,12 +120,7 @@
 		
 	    builderComposite = new BuilderSelectionComposite(parent);
 	    builderComposite.createControls();
-	    builderComposite.getBuilderCombo().addSelectionListener(new SelectionListener() {
-
-			public void widgetDefaultSelected(SelectionEvent e) {
-				widgetSelected(e);
-			}
-
+	    builderComposite.getBuilderCombo().addSelectionListener(new SelectionAdapter() {
 			public void widgetSelected(SelectionEvent e) {
 				setPageComplete(validatePage());
 			}
@@ -207,7 +203,7 @@
 		
 		if (builderComposite != null) {
 			
-			IStatus status = builderComposite.validatePage();
+			IStatus status = builderComposite.validate();
         	if (status != null){
         		// Get the level from the status.
         		int level = getMessageLevelFromIStatus(status);
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/messages.properties	Tue Mar 02 13:31:49 2010 -0600
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/messages.properties	Tue Mar 02 13:32:41 2010 -0600
@@ -2,7 +2,7 @@
 NewProjectPage.NameBeginWithDigitError=Project names can not begin with a digit
 NewProjectPage.InvalidProjectName={0} is not a valid project name
 NewProjectPage.builderLabel=Builder:
-NewProjectPage.builderToolTip=Select the builder to use for this project
+NewProjectPage.builderToolTip=Select the builder to use for this project. SBSv1 (abld) or SBSv2 (Raptor)
 NewProjectPage.ProjectNameWithPeriodError=Project names can not contain periods
 NewProjectPage.sbsv1=SBSv1
 NewProjectPage.sbsv2=SBSv2
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/sharedui/BuilderSelectionComposite.java	Tue Mar 02 13:31:49 2010 -0600
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/sharedui/BuilderSelectionComposite.java	Tue Mar 02 13:32:41 2010 -0600
@@ -66,17 +66,6 @@
 		builderCombo.add(Messages.getString("NewProjectPage.sbsv2")); //$NON-NLS-1$
 		builderCombo.setData(".uid", "builderCombo"); //$NON-NLS-1$ //$NON-NLS-2$
 		builderCombo.select(0);
-//		builderCombo.addSelectionListener(new SelectionListener() {
-//
-//			public void widgetDefaultSelected(SelectionEvent e) {
-//				widgetSelected(e);
-//			}
-//
-//			public void widgetSelected(SelectionEvent e) {
-//				validatePage();
-//			}
-//			
-//		});
     }
 
     /**
@@ -84,7 +73,7 @@
      * listen for changes on the builder combo via {@link #getBuilderCombo()}
      * @return null for no error, otherwise a string for the error message
      */
-    public IStatus validatePage() {
+    public IStatus validate() {
 		useSBSv2Builder = true;
 		IStatus status = null;
 		if (builderCombo != null && builderCombo.getSelectionIndex() == 1) {
@@ -92,7 +81,6 @@
 			// if SBSv2 is selected, make sure SBS_HOME is defined
 			if (SBSv2Utils.getSBSBinDirectory() == null){
 				status = new Status(Status.ERROR, ProjectUIPlugin.PLUGIN_ID, "SBS_HOME environment variable is not defined. Carbide needs this variable to find the base SBS install.");
-				useSBSv2Builder = false;
 			}
 			
 			// check the raptor version
@@ -103,6 +91,8 @@
 				}
 			}
 
+		} else {
+			useSBSv2Builder = false;
 		}
 
 		getShell().setData(BuildTargetsPage.SBSV2BUILDER, new Boolean(useSBSv2Builder));
@@ -145,7 +135,9 @@
     
     /**
      * Get the builder combo that the user select the builder (e.g. SBSv1 or SBSv2)
-     * when creating projects.
+     * when creating projects. This is currently used by clients to listen for changes to the builder combo.
+     * TODO: This probably is not the most friendly method. After review we decided it would be cleaner for 
+     * clients to pass in a validator interface (e.g. IBuildComboValidator) and make call backs on that. 
      * @return the Combo
      */
     public Combo getBuilderCombo(){
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/project/ui/sharedui/NewProjectPage.java	Tue Mar 02 13:31:49 2010 -0600
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/project/ui/sharedui/NewProjectPage.java	Tue Mar 02 13:32:41 2010 -0600
@@ -29,8 +29,8 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
@@ -156,7 +156,7 @@
 		
         if (builderComposite != null) {
         	
-        	IStatus status = builderComposite.validatePage();
+        	IStatus status = builderComposite.validate();
         	if (status != null){
         		// Get the level from the status.
         		int level = getMessageLevelFromIStatus(status);
@@ -245,12 +245,7 @@
 		if (control instanceof Composite) {
 			builderComposite = new BuilderSelectionComposite((Composite)control);
 		    builderComposite.createControls();
-		    builderComposite.getBuilderCombo().addSelectionListener(new SelectionListener() {
-
-				public void widgetDefaultSelected(SelectionEvent e) {
-					widgetSelected(e);
-				}
-
+		    builderComposite.getBuilderCombo().addSelectionListener(new SelectionAdapter() {
 				public void widgetSelected(SelectionEvent e) {
 					setPageComplete(validatePage());
 				}
--- a/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/QtProFileSelectionPage.java	Tue Mar 02 13:31:49 2010 -0600
+++ b/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/QtProFileSelectionPage.java	Tue Mar 02 13:32:41 2010 -0600
@@ -32,6 +32,7 @@
 import org.eclipse.jface.dialogs.IDialogSettings;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Font;
@@ -120,12 +121,7 @@
 
         builderComposite = new BuilderSelectionComposite(parent);
         builderComposite.createControls();
-        builderComposite.getBuilderCombo().addSelectionListener(new SelectionListener() {
-
-			public void widgetDefaultSelected(SelectionEvent e) {
-				widgetSelected(e);
-			}
-
+        builderComposite.getBuilderCombo().addSelectionListener(new SelectionAdapter() {
 			public void widgetSelected(SelectionEvent e) {
 				setPageComplete(validatePage());
 			}
@@ -248,7 +244,7 @@
 
 		if (builderComposite != null) {
 
-			IStatus status = builderComposite.validatePage();
+			IStatus status = builderComposite.validate();
         	if (status != null){
         		// Get the level from the status.
         		int level = getMessageLevelFromIStatus(status);