From dd720e158ad0138ecd68b02dd328f410a9120852 Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Thu, 19 Jul 2007 16:46:56 +0000 Subject: [PATCH] [174789] [performance] Don't contribute Property Pages to Wizard automatically --- .../ISystemConnectionWizardPropertyPage.java | 12 ++++++- .../view/SubSystemConfigurationAdapter.java | 36 +++++++++++-------- .../SystemSubSystemsPropertiesWizardPage.java | 10 +++++- 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardPropertyPage.java index 6363983bf23..3f7688fbd38 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardPropertyPage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardPropertyPage.java @@ -12,17 +12,27 @@ * * Contributors: * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType + * Martin Oberhuber (Wind River) - [174789] [performance] Don't contribute Property Pages to Wizard automatically ********************************************************************************/ package org.eclipse.rse.ui.propertypages; +import org.eclipse.jface.wizard.IWizard; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; +import org.eclipse.rse.ui.view.SubSystemConfigurationAdapter; /** - * interface for a property page that can be shown in the new connection wizard + * interface for a property page that can be shown in the new connection wizard. + * + * @deprecated this class will likely be removed in the future, because the + * underlying mechanism of contributing property pages to a wizard + * does not scale since it activates unrelated plug-ins. Custom wizard + * pages should be contributed through + * {@link SubSystemConfigurationAdapter#getNewConnectionWizardPages(ISubSystemConfiguration, IWizard)} + * instead. See also Eclipse Bugzilla bug 197129. */ public interface ISystemConnectionWizardPropertyPage { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapter.java index 6d42748d2cc..8fdd13d1b7f 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapter.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SubSystemConfigurationAdapter.java @@ -15,6 +15,7 @@ * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [189123] Move renameSubSystemProfile() from UI to Core * Martin Oberhuber (Wind River) - [190231] Remove UI-only code from SubSystemConfiguration + * Martin Oberhuber (Wind River) - [174789] [performance] Don't contribute Property Pages to Wizard automatically ********************************************************************************/ package org.eclipse.rse.ui.view; @@ -91,7 +92,6 @@ import org.eclipse.rse.ui.validators.ValidatorSpecialChar; import org.eclipse.rse.ui.widgets.IServerLauncherForm; import org.eclipse.rse.ui.widgets.RemoteServerLauncherForm; import org.eclipse.rse.ui.wizards.SubSystemServiceWizardPage; -import org.eclipse.rse.ui.wizards.SystemSubSystemsPropertiesWizardPage; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; @@ -200,23 +200,21 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda SubSystemServiceWizardPage page = new SubSystemServiceWizardPage(wizard, config); return new ISystemNewConnectionWizardPage[] {page}; } - else - { - List pages = getSubSystemPropertyPages(config); - if (pages != null && pages.size() > 0) - { - SystemSubSystemsPropertiesWizardPage page = new SystemSubSystemsPropertiesWizardPage(wizard, config, pages); - return new ISystemNewConnectionWizardPage[] {page}; - } - } + //MOB Removed due to performance issue -- see Eclipse Bugzilla bug 174789 +// else +// { +// List pages = getSubSystemPropertyPages(config); +// if (pages != null && pages.size() > 0) +// { +// SystemSubSystemsPropertiesWizardPage page = new SystemSubSystemsPropertiesWizardPage(wizard, config, pages); +// return new ISystemNewConnectionWizardPage[] {page}; +// } +// } return new ISystemNewConnectionWizardPage[0]; } - - - /* - * Return the form used in the subsyste property page. This default implementation returns Syste + * Return the form used in the subsystem property page. This default implementation returns Syste */ public ISystemSubSystemPropertyPageCoreForm getSubSystemPropertyPageCoreFrom(ISubSystemConfiguration config, ISystemMessageLine msgLine, Object caller) { @@ -226,6 +224,14 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda /** * Gets the list of property pages applicable for a subsystem associated with this subsystem configuration * @return the list of subsystem property pages + * + * @deprecated this method will likely be removed in the future, because the + * underlying mechanism of finding the registered property pages for a + * SubSystemConfiguration does not scale since it activates unrelated + * plug-ins. Existing Platform functionality for getting the list of + * property pages registered against a SubSystem should be used, once + * the SubSystem class is loaded -- but not by referencing the + * SubSystemConfiguration. See also Eclipse Bugzilla bug 197129. */ protected List getSubSystemPropertyPages(ISubSystemConfiguration config) { @@ -243,7 +249,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda String objectClass = configurationElement.getAttribute("objectClass"); //$NON-NLS-1$ // The objectClass attribute is a) deprecated and b) optional. If null, do not - // try to instanciate a class from it as it will lead to a NPE. It is very bad + // try to instantiate a class from it as it will lead to a NPE. It is very bad // style to let throw the exception and catch it with an empty catch block. If // the debugger is configured to intercept NPE's, we end up always here. if (objectClass == null) continue; 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 ee236f35c2a..e90519b4018 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 @@ -12,6 +12,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [190231] Move ISubSystemPropertiesWizardPage from UI to Core + * Martin Oberhuber (Wind River) - [174789] [performance] Don't contribute Property Pages to Wizard automatically ********************************************************************************/ package org.eclipse.rse.ui.wizards; @@ -28,6 +29,7 @@ import org.eclipse.rse.ui.ISystemVerifyListener; import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.propertypages.ISystemConnectionWizardErrorUpdater; import org.eclipse.rse.ui.propertypages.ISystemConnectionWizardPropertyPage; +import org.eclipse.rse.ui.view.SubSystemConfigurationAdapter; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; @@ -39,7 +41,13 @@ import org.eclipse.ui.dialogs.PropertyPage; /** * Wizard page that display the property pages for a given subsystem in the * connection - * + * + * @deprecated this class will likely be removed in the future, because the + * underlying mechanism of contributing property pages to a wizard + * does not scale since it activates unrelated plug-ins. Custom wizard + * pages should be contributed through + * {@link SubSystemConfigurationAdapter#getNewConnectionWizardPages(ISubSystemConfiguration, IWizard)} + * instead. See also Eclipse Bugzilla bug 197129. */ public class SystemSubSystemsPropertiesWizardPage extends AbstractSystemNewConnectionWizardPage