mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
don't show tabs on wiz page where there's only 1 property page
This commit is contained in:
parent
07ba899f07
commit
23ab7d6343
1 changed files with 39 additions and 24 deletions
|
@ -103,44 +103,59 @@ public class SystemSubSystemsPropertiesWizardPage
|
||||||
{
|
{
|
||||||
int nbrColumns = 2;
|
int nbrColumns = 2;
|
||||||
Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
|
Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
|
||||||
|
|
||||||
_folder = new CTabFolder(composite_prompts, SWT.NONE);
|
|
||||||
_folder.setLayout(new TabFolderLayout());
|
|
||||||
|
|
||||||
int numAdded = 0;
|
int numAdded = 0;
|
||||||
for (int i = 0; i < _propertyPages.size(); i++)
|
if (_propertyPages.size() == 1)
|
||||||
{
|
{
|
||||||
PropertyPage page = (PropertyPage)_propertyPages.get(i);
|
PropertyPage page = (PropertyPage)_propertyPages.get(0);
|
||||||
if (page != null && page instanceof ISystemConnectionWizardPropertyPage)
|
if (page != null && page instanceof ISystemConnectionWizardPropertyPage)
|
||||||
{
|
{
|
||||||
ISystemConnectionWizardPropertyPage cpage = (ISystemConnectionWizardPropertyPage)page;
|
ISystemConnectionWizardPropertyPage cpage = (ISystemConnectionWizardPropertyPage)page;
|
||||||
cpage.setSubSystemConfiguration(parentFactory);
|
cpage.setSubSystemConfiguration(parentFactory);
|
||||||
|
page.createControl(composite_prompts);
|
||||||
|
|
||||||
CTabItem titem = new CTabItem(_folder, SWT.NULL, numAdded);
|
|
||||||
titem.setData(page);
|
|
||||||
page.createControl(_folder);
|
|
||||||
titem.setText(page.getTitle());
|
|
||||||
try
|
|
||||||
{
|
|
||||||
titem.setControl(page.getControl());
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
// TODO why does the tabfolder hit exception the
|
|
||||||
// first tiem setcontrol is called?
|
|
||||||
}
|
|
||||||
|
|
||||||
//set the hostname for the page in case it's required
|
//set the hostname for the page in case it's required
|
||||||
cpage.setHostname(getMainPage().getHostName());
|
cpage.setHostname(getMainPage().getHostName());
|
||||||
cpage.setSystemType(getMainPage().getSystemType());
|
|
||||||
|
|
||||||
numAdded++;
|
numAdded++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_folder = new CTabFolder(composite_prompts, SWT.NONE);
|
||||||
|
_folder.setLayout(new TabFolderLayout());
|
||||||
|
|
||||||
|
|
||||||
|
for (int i = 0; i < _propertyPages.size(); i++)
|
||||||
|
{
|
||||||
|
PropertyPage page = (PropertyPage)_propertyPages.get(i);
|
||||||
|
if (page != null && page instanceof ISystemConnectionWizardPropertyPage)
|
||||||
|
{
|
||||||
|
ISystemConnectionWizardPropertyPage cpage = (ISystemConnectionWizardPropertyPage)page;
|
||||||
|
cpage.setSubSystemConfiguration(parentFactory);
|
||||||
|
|
||||||
|
CTabItem titem = new CTabItem(_folder, SWT.NULL, numAdded);
|
||||||
|
titem.setData(page);
|
||||||
|
page.createControl(_folder);
|
||||||
|
titem.setText(page.getTitle());
|
||||||
|
try
|
||||||
|
{
|
||||||
|
titem.setControl(page.getControl());
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
// TODO why does the tabfolder hit exception the
|
||||||
|
// first tiem setcontrol is called?
|
||||||
|
}
|
||||||
|
|
||||||
|
//set the hostname for the page in case it's required
|
||||||
|
cpage.setHostname(getMainPage().getHostName());
|
||||||
|
|
||||||
|
numAdded++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (numAdded == 0)
|
if (numAdded == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue