From 44ee48ce0bb11992f71812f612e8845b6bdd0995 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Mon, 5 Nov 2007 17:51:59 +0000 Subject: [PATCH] [197129] Removing obsolete ISystemConnectionWizardPropertyPage and SystemSubSystemsPropertiesWizardPage --- .../ServerConnectionSecurityPropertyPage.java | 4 +- .../ServerLauncherPropertyPage.java | 5 +- .../ISystemConnectionWizardPropertyPage.java | 43 --- .../view/SubSystemConfigurationAdapter.java | 66 +--- .../SystemSubSystemsPropertiesWizardPage.java | 302 ------------------ 5 files changed, 7 insertions(+), 413 deletions(-) delete mode 100644 rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardPropertyPage.java delete mode 100644 rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemSubSystemsPropertiesWizardPage.java diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/propertypages/ServerConnectionSecurityPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/propertypages/ServerConnectionSecurityPropertyPage.java index 1144f39d47a..39ef15d2988 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/propertypages/ServerConnectionSecurityPropertyPage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/propertypages/ServerConnectionSecurityPropertyPage.java @@ -12,6 +12,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType + * David McKnight (IBM) - [197129] Removing obsolete ISystemConnectionWizardPropertyPage and SystemSubSystemsPropertiesWizardPage ********************************************************************************/ package org.eclipse.rse.internal.ui.propertypages; @@ -26,13 +27,12 @@ import org.eclipse.rse.internal.ui.widgets.ServerConnectionSecurityForm; import org.eclipse.rse.ui.ISystemPreferencesConstants; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemWidgetHelpers; -import org.eclipse.rse.ui.propertypages.ISystemConnectionWizardPropertyPage; import org.eclipse.rse.ui.propertypages.SystemBasePropertyPage; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -public class ServerConnectionSecurityPropertyPage extends SystemBasePropertyPage implements ISystemConnectionWizardPropertyPage +public class ServerConnectionSecurityPropertyPage extends SystemBasePropertyPage { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/propertypages/ServerLauncherPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/propertypages/ServerLauncherPropertyPage.java index abba214255a..01c7942f51c 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/propertypages/ServerLauncherPropertyPage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/propertypages/ServerLauncherPropertyPage.java @@ -13,6 +13,7 @@ * Contributors: * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util + * David McKnight (IBM) - [197129] Removing obsolete ISystemConnectionWizardPropertyPage and SystemSubSystemsPropertiesWizardPage ********************************************************************************/ package org.eclipse.rse.internal.ui.propertypages; @@ -25,7 +26,6 @@ import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.SubSystem; import org.eclipse.rse.ui.ISystemVerifyListener; import org.eclipse.rse.ui.propertypages.ISystemConnectionWizardErrorUpdater; -import org.eclipse.rse.ui.propertypages.ISystemConnectionWizardPropertyPage; import org.eclipse.rse.ui.propertypages.SystemBasePropertyPage; import org.eclipse.rse.ui.subsystems.ISubSystemConfigurationAdapter; import org.eclipse.rse.ui.widgets.IServerLauncherForm; @@ -37,7 +37,8 @@ import org.eclipse.swt.widgets.Control; * Property page for editing persistant environment variables for an * RSE connection. */ -public class ServerLauncherPropertyPage extends SystemBasePropertyPage implements ISystemConnectionWizardPropertyPage, ISystemConnectionWizardErrorUpdater +public class ServerLauncherPropertyPage extends SystemBasePropertyPage +//implements ISystemConnectionWizardPropertyPage, ISystemConnectionWizardErrorUpdater { private IServerLauncherForm _form; 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 deleted file mode 100644 index 3f7688fbd38..00000000000 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/ISystemConnectionWizardPropertyPage.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved. - * This program and the accompanying materials are made available under the terms - * of the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following IBM employees contributed to the Remote System Explorer - * component that contains this file: David McKnight, Kushal Munir, - * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, - * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. - * - * 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. - * - * @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 -{ - public boolean applyValues(IConnectorService subsystem); - public void setSubSystemConfiguration(ISubSystemConfiguration factory); - public void setHostname(String hostname); - public void setSystemType(IRSESystemType systemType); -} \ No newline at end of file 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 8fdd13d1b7f..a9bc97130d6 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 @@ -16,17 +16,14 @@ * 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 + * David McKnight (IBM) - [197129] Removing obsolete ISystemConnectionWizardPropertyPage and SystemSubSystemsPropertiesWizardPage ********************************************************************************/ package org.eclipse.rse.ui.view; -import java.util.ArrayList; import java.util.Hashtable; -import java.util.List; import java.util.Vector; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.Platform; import org.eclipse.jface.action.IAction; import org.eclipse.jface.resource.ImageDescriptor; @@ -221,66 +218,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda return new SystemSubSystemPropertyPageCoreForm(msgLine, caller); } - /** - * 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) - { - List propertyPages= new ArrayList(); - // Get reference to the plug-in registry - IExtensionRegistry registry = Platform.getExtensionRegistry(); - - // Get configured property page extenders - IConfigurationElement[] propertyPageExtensions = - registry.getConfigurationElementsFor("org.eclipse.ui", "propertyPages"); //$NON-NLS-1$ //$NON-NLS-2$ - - for (int i = 0; i < propertyPageExtensions.length; i++) - { - IConfigurationElement configurationElement = propertyPageExtensions[i]; - - String objectClass = configurationElement.getAttribute("objectClass"); //$NON-NLS-1$ - // The objectClass attribute is a) deprecated and b) optional. If null, do not - // 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; - - String name = configurationElement.getAttribute("name"); //$NON-NLS-1$ - Class objCls = null; - try - { - ClassLoader loader = getClass().getClassLoader(); - objCls = Class.forName(objectClass, false, loader); - } - catch (Exception e) - { - } - - - if (objCls != null && ISubSystem.class.isAssignableFrom(objCls) && config.isFactoryFor(objCls)) - { - try - { - PropertyPage page = (PropertyPage) configurationElement.createExecutableExtension("class"); //$NON-NLS-1$ - page.setTitle(name); - propertyPages.add(page); - } - catch (Exception e) - { - } - } - } - return propertyPages; - } + // FIXME - UDAs no longer coupled with config in core // // --------------------------------- 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 deleted file mode 100644 index e90519b4018..00000000000 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemSubSystemsPropertiesWizardPage.java +++ /dev/null @@ -1,302 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved. - * This program and the accompanying materials are made available under the terms - * of the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following IBM employees contributed to the Remote System Explorer - * component that contains this file: David McKnight, Kushal Munir, - * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, - * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. - * - * 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; - -import java.util.List; - -import org.eclipse.jface.wizard.IWizard; -import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; -import org.eclipse.rse.core.subsystems.ISubSystemPropertiesWizardPage; -import org.eclipse.rse.internal.ui.SystemResources; -import org.eclipse.rse.internal.ui.view.monitor.TabFolderLayout; -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; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -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 - implements ISystemVerifyListener, ISubSystemPropertiesWizardPage -{ - private ISystemConnectionWizardPropertyPage _thePage; // only if there's one page - private CTabFolder _folder; - private List _propertyPages; - private String _lastHostName; - /** - * Constructor - */ - public SystemSubSystemsPropertiesWizardPage(IWizard wizard, ISubSystemConfiguration parentFactory, List propertyPages) - { - //super(wizard, parentFactory); todo: use this when we enable port - // selection - super( - wizard, - parentFactory, - parentFactory.getId(), - // removed subsystem append since not correct for some languages - parentFactory.getName(), - //+ " " + SystemResources.RESID_SUBSYSTEM_TYPE_VALUE), - //" SubSystem Properties", //TODO create - // message for - // this - //"Configure properties of this subsystem" - SystemResources.RESID_NEWCONN_SUBSYSTEMPAGE_DESCRIPTION - ); - _propertyPages = propertyPages; - } - - /** - * @see AbstractSystemWizardPage#getInitialFocusControl() - */ - protected Control getInitialFocusControl() - { - return getControl(); - } - - /* - * Updates wiard property pages with new hostname - */ - protected void hostNameUpdated(String hostName) - { - if (_folder != null) - { - for (int i = 0; i < _folder.getItemCount(); i++) - { - ISystemConnectionWizardPropertyPage page = - (ISystemConnectionWizardPropertyPage) _folder.getItem(i).getData(); - page.setHostname(hostName); - } - } - - } - - /** - * @see AbstractSystemWizardPage#createContents(Composite) - */ - public Control createContents(Composite parent) - { - int nbrColumns = 2; - Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns); - int numAdded = 0; - if (_propertyPages.size() == 1) - { - PropertyPage page = (PropertyPage)_propertyPages.get(0); - if (page != null && page instanceof ISystemConnectionWizardPropertyPage) - { - ISystemConnectionWizardPropertyPage cpage = (ISystemConnectionWizardPropertyPage)page; - cpage.setSubSystemConfiguration(parentFactory); - page.createControl(composite_prompts); - _thePage = cpage; - - //set the hostname for the page in case it's required - if (getMainPage() != null) cpage.setHostname(getMainPage().getSystemConnectionForm().getHostName()); - - 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 - if (getMainPage() != null) cpage.setHostname(getMainPage().getSystemConnectionForm().getHostName()); - - numAdded++; - } - } - } - if (numAdded == 0) - { - - } - addVerifyListener(); - - return composite_prompts; - } - - /** - * @see ISystemWizardPage#performFinish() - */ - public boolean performFinish() - { - return true; - } - - public boolean applyValues(ISubSystem ss) - { - boolean result = true; - if (_folder != null) - { - for (int i = 0; i < _folder.getItemCount() && result; i++) - { - ISystemConnectionWizardPropertyPage page = - (ISystemConnectionWizardPropertyPage) _folder.getItem(i).getData(); - result = page.applyValues(ss.getConnectorService()); - } - } - else if (_thePage != null) - { - _thePage.applyValues(ss.getConnectorService()); - } - return result; - } - - /** - * Return true if the page is complete, so to enable Finish. Called by - * wizard framework. - */ - public boolean isPageComplete() - { - String hostName = getMainPage() != null ? getMainPage().getSystemConnectionForm().getHostName() : null; - if (hostName != null && !hostName.equals(_lastHostName)) - { - hostNameUpdated(hostName); - _lastHostName = hostName; - } - boolean result = true; - if (_folder != null) - { - for (int i = 0; i < _folder.getItemCount() && result; i++) - { - if (_folder.getItem(i).getData() instanceof ISystemConnectionWizardErrorUpdater) - { - ISystemConnectionWizardErrorUpdater page = - (ISystemConnectionWizardErrorUpdater) _folder.getItem(i).getData(); - result = page.isPageComplete(); - } - } - } - else if (_thePage != null) - { - if (_thePage instanceof ISystemConnectionWizardErrorUpdater) - { - result = ((ISystemConnectionWizardErrorUpdater)_thePage).isPageComplete(); - } - } - return result; - - } - - protected void addVerifyListener() - { - if (_folder != null) - { - for (int i = 0; i < _folder.getItemCount(); i++) - { - if (_folder.getItem(i).getData() instanceof ISystemConnectionWizardErrorUpdater) - { - ISystemConnectionWizardErrorUpdater page = - (ISystemConnectionWizardErrorUpdater) _folder.getItem(i).getData(); - page.addVerifyListener(this); - } - } - } - else if (_thePage != null) - { - if (_thePage instanceof ISystemConnectionWizardErrorUpdater) - { - ((ISystemConnectionWizardErrorUpdater)_thePage).addVerifyListener(this); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent) - */ - public void handleVerifyComplete() - { - boolean complete = isPageComplete(); - if (!complete) - { - if (_folder != null) - { - for (int i = 0; i < _folder.getItemCount(); i++) - { - if (_folder.getItem(i).getData() instanceof ISystemConnectionWizardErrorUpdater) - { - ISystemConnectionWizardErrorUpdater page = - (ISystemConnectionWizardErrorUpdater) _folder.getItem(i).getData(); - String error = page.getTheErrorMessage(); - if (error != null && !error.equals("")) //$NON-NLS-1$ - { - setErrorMessage(_folder.getItem(i).getText() + ": " + page.getTheErrorMessage()); //$NON-NLS-1$ - } - } - } - } - else if (_thePage != null) - { - if (_thePage instanceof ISystemConnectionWizardErrorUpdater) - { - ((ISystemConnectionWizardErrorUpdater)_thePage).getTheErrorMessage(); - } - } - } - else - { - clearErrorMessage(); - } - setPageComplete(complete); - } -} \ No newline at end of file