mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Bug: NPE with MBS custom pages
This commit is contained in:
parent
612780f89e
commit
f6189e564a
3 changed files with 14 additions and 9 deletions
|
@ -44,7 +44,7 @@ public class CNewWizard extends AbstractCWizard {
|
||||||
for (int i=0; i<vs.length; i++) {
|
for (int i=0; i<vs.length; i++) {
|
||||||
IToolChain[] tcs = ManagedBuildManager.getExtensionsToolChains(ICWizardHandler.ARTIFACT, vs[i].getId());
|
IToolChain[] tcs = ManagedBuildManager.getExtensionsToolChains(ICWizardHandler.ARTIFACT, vs[i].getId());
|
||||||
if (tcs == null || tcs.length == 0) continue;
|
if (tcs == null || tcs.length == 0) continue;
|
||||||
MBSWizardHandler h = new MBSWizardHandler(vs[i], IMG1, parent, listener, wizard);
|
MBSWizardHandler h = new MBSWizardHandler(vs[i], IMG1, parent, wizard);
|
||||||
for (int j=0; j<tcs.length; j++) {
|
for (int j=0; j<tcs.length; j++) {
|
||||||
if (!supportedOnly || isValid(tcs[j])) h.addTc(tcs[j]);
|
if (!supportedOnly || isValid(tcs[j])) h.addTc(tcs[j]);
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ public class CNewWizard extends AbstractCWizard {
|
||||||
if (supportedOnly && !pt.isSupported()) continue; // not supported
|
if (supportedOnly && !pt.isSupported()) continue; // not supported
|
||||||
String nattr = pt.getNameAttribute();
|
String nattr = pt.getNameAttribute();
|
||||||
if (nattr == null || nattr.length() == 0) continue; // new proj style
|
if (nattr == null || nattr.length() == 0) continue; // new proj style
|
||||||
MBSWizardHandler h = new MBSWizardHandler(pt.getName(), pt, IMG2, parent, listener, wizard);
|
MBSWizardHandler h = new MBSWizardHandler(pt.getName(), pt, IMG2, parent, wizard);
|
||||||
IConfiguration[] cfgs = pt.getConfigurations();
|
IConfiguration[] cfgs = pt.getConfigurations();
|
||||||
if (cfgs == null || cfgs.length == 0) continue;
|
if (cfgs == null || cfgs.length == 0) continue;
|
||||||
IToolChain tc = null;
|
IToolChain tc = null;
|
||||||
|
|
|
@ -76,17 +76,19 @@ public class MBSWizardHandler extends CWizardHandler implements ICBuildWizardHan
|
||||||
private IToolChain[] savedToolChains = null;
|
private IToolChain[] savedToolChains = null;
|
||||||
private IWizard wizard;
|
private IWizard wizard;
|
||||||
|
|
||||||
public MBSWizardHandler(String _name, IProjectType _pt, Image _image, Composite p, IWizardItemsListListener _listener, IWizard w) {
|
public MBSWizardHandler(String _name, IProjectType _pt, Image _image, Composite p, IWizard w) {
|
||||||
super(p, Messages.getString("CWizardHandler.0"), _name, _image); //$NON-NLS-1$
|
super(p, Messages.getString("CWizardHandler.0"), _name, _image); //$NON-NLS-1$
|
||||||
pt = _pt;
|
pt = _pt;
|
||||||
listener = _listener;
|
if (w.getStartingPage() instanceof IWizardItemsListListener)
|
||||||
|
listener = (IWizardItemsListListener)w.getStartingPage();
|
||||||
wizard = w;
|
wizard = w;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MBSWizardHandler(IBuildPropertyValue val, Image _image, Composite p, IWizardItemsListListener _listener, IWizard w) {
|
public MBSWizardHandler(IBuildPropertyValue val, Image _image, Composite p, IWizard w) {
|
||||||
super(p, Messages.getString("CWizardHandler.0"), val.getName(), _image); //$NON-NLS-1$
|
super(p, Messages.getString("CWizardHandler.0"), val.getName(), _image); //$NON-NLS-1$
|
||||||
propertyId = val.getId();
|
propertyId = val.getId();
|
||||||
listener = _listener;
|
if (w.getStartingPage() instanceof IWizardItemsListListener)
|
||||||
|
listener = (IWizardItemsListListener)w.getStartingPage();
|
||||||
wizard = w;
|
wizard = w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,6 +202,7 @@ public class MBSWizardHandler extends CWizardHandler implements ICBuildWizardHan
|
||||||
coreModel.setProjectDescription(project, des);
|
coreModel.setProjectDescription(project, des);
|
||||||
|
|
||||||
// process custom pages
|
// process custom pages
|
||||||
|
if (fConfigPage != null && fConfigPage.pagesLoaded)
|
||||||
doCustom();
|
doCustom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,7 +308,9 @@ public class MBSWizardHandler extends CWizardHandler implements ICBuildWizardHan
|
||||||
|
|
||||||
private void deleteExtraConfigs(IProject newProject) {
|
private void deleteExtraConfigs(IProject newProject) {
|
||||||
if (isChanged()) return; // no need to delete
|
if (isChanged()) return; // no need to delete
|
||||||
if (listener.isCurrent()) return; // nothing to delete
|
if (listener != null && listener.isCurrent()) return; // nothing to delete
|
||||||
|
if (fConfigPage == null || !fConfigPage.pagesLoaded) return;
|
||||||
|
|
||||||
ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(newProject, true);
|
ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(newProject, true);
|
||||||
if (prjd == null) return;
|
if (prjd == null) return;
|
||||||
ICConfigurationDescription[] all = prjd.getConfigurations();
|
ICConfigurationDescription[] all = prjd.getConfigurations();
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
public class STDWizardHandler extends MBSWizardHandler {
|
public class STDWizardHandler extends MBSWizardHandler {
|
||||||
|
|
||||||
public STDWizardHandler(String _name, Image _image, Composite p, IWizard w) {
|
public STDWizardHandler(String _name, Image _image, Composite p, IWizard w) {
|
||||||
super(_name, null, _image, p, null, w);
|
super(_name, null, _image, p, w);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addTc(IToolChain tc) {
|
public void addTc(IToolChain tc) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue