Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcartu38 opendev2017-03-21 14:28:58 -0400
committerJonah Graham2017-03-27 07:24:26 -0400
commit6b88578458fc52d97cbe61297aef5dd4b1595f4c (patch)
tree9616a4d7ee2a6de5638c5ffcfb91defec261b075 /build/org.eclipse.cdt.managedbuilder.ui
parent2268403e0255795fc16e2669849ad4c8d46b41a5 (diff)
downloadorg.eclipse.cdt-6b88578458fc52d97cbe61297aef5dd4b1595f4c.tar.gz
org.eclipse.cdt-6b88578458fc52d97cbe61297aef5dd4b1595f4c.tar.xz
org.eclipse.cdt-6b88578458fc52d97cbe61297aef5dd4b1595f4c.zip
Bug 514244: ability to add custom wizard page prior project creation one
See : https://www.eclipse.org/forums/index.php/t/1084842/ Original (WizardNewProjectCreationPage) getStartingPage() cast within getMainPageData() method was obviously forcing first wizard page type ... provided basic trick is opening some opportunities more ! Change-Id: Ie9b7c4ef63040df6a419af8348f088be79cc2611 Signed-off-by: cartu38 opendev <cartu38.opendev@gmail.com>
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java47
2 files changed, 38 insertions, 11 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
index 0c8a0b7486..2b53e246ff 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.ui; singleton:=true
-Bundle-Version: 9.0.0.qualifier
+Bundle-Version: 9.1.0.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java
index dd75fa520b..1413ccf882 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java
@@ -102,7 +102,7 @@ public class MBSWizardHandler extends CWizardHandler {
protected CDTConfigWizardPage fConfigPage;
private IToolChain[] savedToolChains = null;
private IWizard wizard;
- private IWizardPage startingPage;
+ private IWizardPage newProjectCreationPage;
// private EntryDescriptor entryDescriptor = null;
private EntryInfo entryInfo;
protected CfgHolder[] cfgs = null;
@@ -346,21 +346,47 @@ public class MBSWizardHandler extends CWizardHandler {
propertyId = val.getId();
setWizard(w);
}
+
private void setWizard(IWizard w) {
if (w != null) {
- if (w.getStartingPage() instanceof IWizardItemsListListener)
- listener = (IWizardItemsListListener)w.getStartingPage();
wizard = w;
- startingPage = w.getStartingPage();
+ for (IWizardPage page : w.getPages()) {
+ if (page instanceof WizardNewProjectCreationPage) {
+ newProjectCreationPage = page;
+ break;
+ }
+ }
+ if (newProjectCreationPage instanceof IWizardItemsListListener)
+ listener = (IWizardItemsListListener) newProjectCreationPage;
}
}
+ /**
+ * Gets the starting page.
+ *
+ * @return the starting page
+ *
+ * @deprecated use {@link #getNewProjectCreationPage()} instead. Starting page is expected to be wizard's
+ * new project creation page.
+ */
+ @Deprecated
protected IWizardPage getStartingPage(){
- return startingPage;
+ return newProjectCreationPage;
+ }
+
+ /**
+ * Gets the new project creation page.
+ *
+ * @return the wizard's new project creation page. New project creation page may differ from wizard's
+ * starting page.
+ * @since 9.1
+ */
+ protected IWizardPage getNewProjectCreationPage() {
+ return newProjectCreationPage;
}
public Map<String, String> getMainPageData() {
- WizardNewProjectCreationPage page = (WizardNewProjectCreationPage)getStartingPage();
+ WizardNewProjectCreationPage page = (WizardNewProjectCreationPage) getNewProjectCreationPage();
Map<String, String> data = new HashMap<String, String>();
String projName = page.getProjectName();
projName = projName != null ? projName.trim() : EMPTY_STR;
@@ -452,7 +478,7 @@ public class MBSWizardHandler extends CWizardHandler {
ICDTCommonProjectWizard wz = (ICDTCommonProjectWizard)getWizard();
MBSCustomPageManager.init();
- MBSCustomPageManager.addStockPage(getStartingPage(), CDTMainWizardPage.PAGE_ID);
+ MBSCustomPageManager.addStockPage(getNewProjectCreationPage(), CDTMainWizardPage.PAGE_ID);
MBSCustomPageManager.addStockPage(getConfigPage(), CDTConfigWizardPage.PAGE_ID);
// load all custom pages specified via extensions
@@ -626,7 +652,8 @@ public class MBSWizardHandler extends CWizardHandler {
if(entryInfo == null)
return;
- Template template = entryInfo.getInitializedTemplate(getStartingPage(), getConfigPage(), getMainPageData());
+ Template template = entryInfo.getInitializedTemplate(getNewProjectCreationPage(), getConfigPage(),
+ getMainPageData());
if(template == null)
return;
@@ -651,7 +678,7 @@ public class MBSWizardHandler extends CWizardHandler {
@Override
public IWizardPage getSpecificPage() {
- return entryInfo.getNextPage(getStartingPage(), getConfigPage());
+ return entryInfo.getNextPage(getNewProjectCreationPage(), getConfigPage());
}
/**
@@ -872,7 +899,7 @@ public class MBSWizardHandler extends CWizardHandler {
if (!getConfigPage().isCustomPageComplete())
return false;
- if(!entryInfo.canFinish(startingPage, getConfigPage()))
+ if(!entryInfo.canFinish(newProjectCreationPage, getConfigPage()))
return false;
if (customPages != null)

Back to the top