From 23ab7d63439945715bf7f8653552335b47b05151 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Tue, 12 Sep 2006 18:39:55 +0000 Subject: [PATCH] don't show tabs on wiz page where there's only 1 property page --- .../SystemSubSystemsPropertiesWizardPage.java | 63 ++++++++++++------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemSubSystemsPropertiesWizardPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemSubSystemsPropertiesWizardPage.java index 63d34f06a81..e3c35a21821 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemSubSystemsPropertiesWizardPage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemSubSystemsPropertiesWizardPage.java @@ -103,44 +103,59 @@ public class SystemSubSystemsPropertiesWizardPage { int nbrColumns = 2; Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns); - - _folder = new CTabFolder(composite_prompts, SWT.NONE); - _folder.setLayout(new TabFolderLayout()); - 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) { 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? - } + page.createControl(composite_prompts); + //set the hostname for the page in case it's required cpage.setHostname(getMainPage().getHostName()); - cpage.setSystemType(getMainPage().getSystemType()); 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) {