Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Treggiari2005-01-28 03:32:24 +0000
committerLeo Treggiari2005-01-28 03:32:24 +0000
commit60b9d81d5055e27704ad1f2e2cc1c4ae9777f2d1 (patch)
treef5c440e06602cc4c33098456cb2a44d6dba0b831 /build/org.eclipse.cdt.managedbuilder.ui/src
parenta37e05f7ec19324d796d977203d9b6e900f793c4 (diff)
downloadorg.eclipse.cdt-60b9d81d5055e27704ad1f2e2cc1c4ae9777f2d1.tar.gz
org.eclipse.cdt-60b9d81d5055e27704ad1f2e2cc1c4ae9777f2d1.tar.xz
org.eclipse.cdt-60b9d81d5055e27704ad1f2e2cc1c4ae9777f2d1.zip
Use instanceof to match the builtin wizard pages to allow for easier extensions
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui/src')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java31
2 files changed, 26 insertions, 17 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
index 35cc4d7397..d27ee07522 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2002,2004 IBM Corporation and others.
+ * Copyright (c) 2002,2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
@@ -72,10 +72,12 @@ public class NewManagedProjectOptionPage extends NewCProjectWizardOptionPage {
ICOptionPage page = (ICOptionPage) iter.next();
String id = null;
- switch( i ){
- case 0 : id = ManagedBuilderHelpContextIds.MAN_PROJ_WIZ_PROJECTS_TAB; break;
- case 1 : id = ManagedBuilderHelpContextIds.MAN_PROJ_WIZ_ERRORPARSERS_TAB; break;
- case 2 : id = ManagedBuilderHelpContextIds.MAN_PROJ_WIZ_INDEXER_TAB; break;
+ if (page instanceof ReferenceBlock) {
+ id = ManagedBuilderHelpContextIds.MAN_PROJ_WIZ_PROJECTS_TAB;
+ } else if (page instanceof ErrorParserBlock) {
+ id = ManagedBuilderHelpContextIds.MAN_PROJ_WIZ_ERRORPARSERS_TAB;
+ } else if (page instanceof IndexerBlock) {
+ id = ManagedBuilderHelpContextIds.MAN_PROJ_WIZ_INDEXER_TAB;
}
WorkbenchHelp.setHelp(page.getControl(), id);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
index 94399d2a51..e6c527194a 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2002,2004 IBM Corporation and others.
+ * Copyright (c) 2002,2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
@@ -13,19 +13,20 @@ package org.eclipse.cdt.managedbuilder.ui.wizards;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ICDescriptor;
import org.eclipse.cdt.managedbuilder.core.BuildException;
-import org.eclipse.cdt.managedbuilder.core.IProjectType;
-import org.eclipse.cdt.managedbuilder.core.IManagedProject;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
-import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IManagedProject;
+import org.eclipse.cdt.managedbuilder.core.IProjectType;
import org.eclipse.cdt.managedbuilder.core.ITargetPlatform;
+import org.eclipse.cdt.managedbuilder.core.IToolChain;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
-import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderHelpContextIds;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIMessages;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
+import org.eclipse.cdt.ui.wizards.NewCProjectWizardPage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -89,15 +90,21 @@ public class NewManagedProjectWizard extends NewCProjectWizard {
IWizardPage [] pages = getPages();
- if( pages != null && pages.length == 3 ){
- WorkbenchHelp.setHelp(pages[0].getControl(), ManagedBuilderHelpContextIds.MAN_PROJ_WIZ_NAME_PAGE);
-
- //pages[1] is the CProjectPlatformPage which already has a help id.
-
- NewManagedProjectOptionPage optionPage = (NewManagedProjectOptionPage) pages[2];
- optionPage.setupHelpContextIds();
+ if (pages != null) {
+ for (int i = 0; i < pages.length; i++) {
+ IWizardPage page = pages[i];
+ if (page instanceof NewCProjectWizardPage) {
+ WorkbenchHelp.setHelp(page.getControl(), ManagedBuilderHelpContextIds.MAN_PROJ_WIZ_NAME_PAGE);
+ }
+ else if (page instanceof NewManagedProjectOptionPage) {
+ NewManagedProjectOptionPage optionPage = (NewManagedProjectOptionPage) page;
+ optionPage.setupHelpContextIds();
+ }
+ // The other built-in page is the CProjectPlatformPage which already has a help id.
+ }
}
}
+
public void updateProjectTypeProperties() {
// Update the error parser list
optionPage.updateProjectTypeProperties();

Back to the top