Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How a MBSCustomPage instance can get current toolchain ?(MBSCustomPage)
How a MBSCustomPage instance can get current toolchain ? [message #1745715] Sat, 15 October 2016 20:31 Go to next message
opendev cartu38 is currently offline opendev cartu38Friend
Messages: 14
Registered: June 2016
Junior Member
Hello,

I'm extending CDT new project wizard adding some MBSCustomPages.
I've several extra toolchains defined.

Overriding isCustomPageComplete() & isPageComplete() methods to control Finish button enabling I need to get from some of my MBSCustomPage instances what's current wizard toolchain.

How can I get such info ?

In other words ...

I would compare my page toolchain :
MBSCustomPageData pageData = MBSCustomPageManager.getPageData(PAGE_ID);
ToolchainData[] toolchains = pageData.getToolchains();

with current wizard toolchain ....

Thks for help.
Br.
Re: How a MBSCustomPage instance can get current toolchain ? [message #1745750 is a reply to message #1745715] Mon, 17 October 2016 07:49 Go to previous message
opendev cartu38 is currently offline opendev cartu38Friend
Messages: 14
Registered: June 2016
Junior Member
Hello,

I've finally found a way by myself. Not sure most elegant way but sounds it's working !

Thks.



public boolean isPageActive() {
Set<String> currentProjectToolchainIdSet = new HashSet<String>();
for (IWizardPage page : MBSCustomPageManager.getPages()) {
if (page instanceof CDTConfigWizardPage) {
CfgHolder[] cfgHolders = ((CDTConfigWizardPage) page).getCfgItems(false);
for (CfgHolder cfgHolder : cfgHolders) {
currentProjectToolchainIdSet.add(cfgHolder.getConfiguration().getToolChain().getId());
}
}
}

ToolchainData[] pageToolchainDatas = MBSCustomPageManager.getPageData(getPageID()).getToolchains();
for (ToolchainData toolchainData : pageToolchainDatas) {
if (currentProjectToolchainIdSet.contains(toolchainData.getId())) {
return true;
}
}
return false;
}
Previous Topic:C++ class code generation using CDT
Next Topic:Arduino Upload and Board Support Packages
Goto Forum:
  


Current Time: Sun Jan 23 02:48:39 GMT 2022

Powered by FUDForum. Page generated in 0.01989 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top