diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeNewConnectionWizardPage.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeNewConnectionWizardPage.java index e6ef8fa3b23..b62fa94a423 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeNewConnectionWizardPage.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeNewConnectionWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006 IBM Corporation. All rights reserved. + * Copyright (c) 2006, 2008 IBM Corporation. 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 @@ -11,7 +11,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI ********************************************************************************/ package org.eclipse.rse.examples.daytime.ui; @@ -21,6 +21,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Text; +import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.examples.daytime.DaytimeResources; import org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage; @@ -37,9 +38,14 @@ public class DaytimeNewConnectionWizardPage extends public Control createContents(Composite parent) { Text field = new Text(parent, SWT.NONE); field.setText(DaytimeResources.DaytimeWizard_TestFieldText); - - // TODO Auto-generated method stub return field; } + + /* (non-Javadoc) + * @see org.eclipse.rse.core.model.ISystemNewSubSystemProperties#applyValues(org.eclipse.rse.core.subsystems.ISubSystem) + */ + public boolean applyValues(ISubSystem ss) { + return true; + } } diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapter.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapter.java index 2911512c088..ff58d059a54 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapter.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 IBM Corporation and others. + * Copyright (c) 2006, 2008 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 @@ -12,7 +12,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI *******************************************************************************/ package org.eclipse.rse.examples.daytime.ui; @@ -21,9 +21,9 @@ import java.util.Vector; import org.eclipse.jface.wizard.IWizard; -import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.ui.view.SubSystemConfigurationAdapter; +import org.eclipse.rse.ui.wizards.newconnection.ISystemNewConnectionWizardPage; public class DaytimeSubSystemConfigurationAdapter extends SubSystemConfigurationAdapter diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISubSystemConfigurator.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISubSystemConfigurator.java new file mode 100644 index 00000000000..1cf4187ea71 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISubSystemConfigurator.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2002, 2008 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: + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI + *******************************************************************************/ + +package org.eclipse.rse.core.model; + +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; + +/** + * An interface used to drive properties into a subsystem during host creation. + * @noimplement This is an internal interface for use in the framework. Potential clients should extend one of the + * subclasses. + */ +public interface ISubSystemConfigurator { + + /** + * Return the subsystem configuration associated with these properties. + */ + public ISubSystemConfiguration getSubSystemConfiguration(); + + /** + * Apply the values herein to a subsystem. + * @param ss the subystem to be affected. + * @return true if the values were applied. + */ + public boolean applyValues(ISubSystem ss); + +} diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemNewConnectionWizardPage.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemNewConnectionWizardPage.java deleted file mode 100644 index c7630371f26..00000000000 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemNewConnectionWizardPage.java +++ /dev/null @@ -1,48 +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: - * {Name} (company) - description of contribution. - *******************************************************************************/ - -package org.eclipse.rse.core.model; - -import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; - -/** - * Interface that all subsystem factory supplied pages contributed to the New Connection wizard - * must implement. - * @see org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage - * @see org.eclipse.rse.ui.view.SubSystemConfigurationAdapter#getNewConnectionWizardPages(org.eclipse.rse.core.subsystems.ISubSystemConfiguration, org.eclipse.jface.wizard.IWizard) - */ -public interface ISystemNewConnectionWizardPage { - - /** - * This is called when the users presses Finish. All that should be done here is validation - * of the input, returning true if all is ok and the finish can proceed. - */ - public boolean performFinish(); - - /** - * This is called frequently by the framework to decide whether to enable the Finish and - * Next buttons. - *

- * Return true if the page is complete and has no errors - */ - public boolean isPageComplete(); - - /** - * Return the subsystem factory that supplied this page - */ - public ISubSystemConfiguration getSubSystemConfiguration(); -} diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java index 46336e013cb..4cc0034b9a4 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java @@ -26,6 +26,7 @@ * Martin Oberhuber (Wind River) - [215820] Move SystemRegistry implementation to Core * David Dykstal (IBM) - [202630] getDefaultPrivateProfile() and ensureDefaultPrivateProfile() are inconsistent * Martin Oberhuber (Wind River) - [cleanup] Add API "since" Javadoc tags + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI ********************************************************************************/ package org.eclipse.rse.core.model; @@ -450,13 +451,13 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie * @param defaultUserId userId to use as the default for the subsystems. * @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants} * that tells us where to store the user Id - * @param newConnectionWizardPages when called from the New Connection wizard this is union of the list of additional - * wizard pages supplied by the subsystem factories that pertain to the specified system type. Else null. + * @param configurators these are the configurators supplied by the subsystem configurations that pertain to the specified system type. Else null. * @return SystemConnection object, or null if it failed to create. This is typically * because the connectionName is not unique. Call getLastException() if necessary. + * @since 3.0 */ public IHost createHost(String profileName, IRSESystemType systemType, String connectionName, String hostName, String description, String defaultUserId, int defaultUserIdLocation, - ISystemNewConnectionWizardPage[] newConnectionWizardPages) throws Exception; + ISubSystemConfigurator[] configurators) throws Exception; /** * Create a connection object. This is a simplified version diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java index e8d0cf5f288..dfd8fe392ca 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java @@ -19,6 +19,7 @@ * David Dykstal (IBM) - [217556] remove service subsystem types * Xuan Chen (IBM) - [223126] [api][breaking] Remove API related to User Actions in RSE Core/UI * Martin Oberhuber (Wind River) - [cleanup] Add API "since" Javadoc tags + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI ********************************************************************************/ package org.eclipse.rse.core.subsystems; @@ -30,7 +31,7 @@ import org.eclipse.rse.core.filters.ISystemFilterPoolManager; import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IRSEPersistableContainer; -import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; +import org.eclipse.rse.core.model.ISubSystemConfigurator; import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.services.IService; @@ -375,10 +376,10 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide * @param conn The connection to create a subsystem for * @param creatingConnection true if we are creating a connection, false if just creating * another subsystem for an existing connection. - * @param yourNewConnectionWizardPages The wizard pages you supplied to the New Connection wizard, via the - * getNewConnectionWizardPages(...) method, or null. + * @param configurators The configurators that will be applied to a new subsystem or null if there are none. + * @since 3.0 */ - public ISubSystem createSubSystem(IHost conn, boolean creatingConnection, ISystemNewConnectionWizardPage[] yourNewConnectionWizardPages); + public ISubSystem createSubSystem(IHost conn, boolean creatingConnection, ISubSystemConfigurator[] configurators); // used in the case where newsubsystems are added after a connection exists public ISubSystem createSubSystemAfterTheFact(IHost conn); diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemPropertiesWizardPage.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemPropertiesWizardPage.java deleted file mode 100644 index 3585995ad37..00000000000 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemPropertiesWizardPage.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2006, 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] Moved from rse.ui.wizards to core.subsystems - ********************************************************************************/ - -package org.eclipse.rse.core.subsystems; - - -public interface ISubSystemPropertiesWizardPage -{ - public boolean applyValues(ISubSystem ss); -} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/model/SystemRegistry.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/model/SystemRegistry.java index 2ad0c67ad3d..0e34fad13bc 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/model/SystemRegistry.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/model/SystemRegistry.java @@ -47,6 +47,7 @@ * David Dykstal (IBM) - [202630] getDefaultPrivateProfile() and ensureDefaultPrivateProfile() are inconsistent * David McKnight (IBM) - [224313] [api] Create RSE Events for MOVE and COPY holding both source and destination fields * David Dykstal (IBM) - [200735][Persistence] Delete a profile that contains a connection and restart, profile is back without connections + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI ********************************************************************************/ package org.eclipse.rse.internal.core.model; @@ -89,7 +90,7 @@ import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISubSystemConfigurationCategories; import org.eclipse.rse.core.model.ISystemContainer; import org.eclipse.rse.core.model.ISystemHostPool; -import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; +import org.eclipse.rse.core.model.ISubSystemConfigurator; import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfileManager; import org.eclipse.rse.core.model.ISystemRegistry; @@ -1481,9 +1482,8 @@ public class SystemRegistry implements ISystemRegistry return localConn; } - /* - * (non-Javadoc) - * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(java.lang.String, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, org.eclipse.rse.core.model.ISystemNewConnectionWizardPage[]) + /* (non-Javadoc) + * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(java.lang.String, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, org.eclipse.rse.core.model.ISubSystemConfigurator[]) */ public IHost createHost( String profileName, @@ -1493,10 +1493,10 @@ public class SystemRegistry implements ISystemRegistry String description, String defaultUserId, int defaultUserIdLocation, - ISystemNewConnectionWizardPage[] newConnectionWizardPages) + ISubSystemConfigurator[] configurators) throws Exception { - return createHost(profileName, systemType, connectionName, hostName, description, defaultUserId, defaultUserIdLocation, true, newConnectionWizardPages); + return createHost(profileName, systemType, connectionName, hostName, description, defaultUserId, defaultUserIdLocation, true, configurators); } /** @@ -1518,16 +1518,14 @@ public class SystemRegistry implements ISystemRegistry * @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants} * that tells us where to set the user Id * @param createSubSystems true to create subsystems for the host, false otherwise. - * @param newConnectionWizardPages when called from the New Connection wizard this is union of the list of additional - * wizard pages supplied by the subsystem factories that pertain to the specified system type. Else null. + * @param configurators the list of all configurators supplied by the subsystem configuration that pertain to the specified system type. Else null. * @return SystemConnection object, or null if it failed to create. This is typically * because the connectionName is not unique. Call getLastException() if necessary. */ - // FIXME need to remove ISystemNewConnectionWizardPage[] from this and replace with IAdaptable[] public IHost createHost(final String profileName, final IRSESystemType systemType, final String hostName, final String hostAddress, final String description, final String defaultUserId, final int defaultUserIdLocation, final boolean createSubSystems, - final ISystemNewConnectionWizardPage[] newConnectionWizardPages) throws Exception { + final ISubSystemConfigurator[] configurators) throws Exception { final ISystemRegistry sr = this; class CreateHostOperation implements ISystemProfileOperation { private IHost host = null; @@ -1560,10 +1558,10 @@ public class SystemRegistry implements ISystemRegistry if (createSubSystems) { // determine the list of configs to use to create subsystems from List configs = new ArrayList(10); // arbitrary but reasonable - if (newConnectionWizardPages != null) { - // if there are wizard pages need to at least use those - for (int i = 0; i < newConnectionWizardPages.length; i++) { - configs.add(newConnectionWizardPages[i].getSubSystemConfiguration()); + if (configurators != null) { + // if there are configurators need to at least use those + for (int i = 0; i < configurators.length; i++) { + configs.add(configurators[i].getSubSystemConfiguration()); } // add any non-service subsystem configs that aren't already there that apply to this systemtype ISubSystemConfiguration[] configsArray = getSubSystemConfigurationsBySystemType(systemType, false); @@ -1587,7 +1585,7 @@ public class SystemRegistry implements ISystemRegistry for (Iterator z = configs.iterator(); z.hasNext();) { ISubSystemConfiguration config = (ISubSystemConfiguration) z.next(); config.getFilterPoolManager(profile, true); // create the filter pool - ISystemNewConnectionWizardPage[] interestingPages = getApplicableWizardPages(config, newConnectionWizardPages); + ISubSystemConfigurator[] interestingPages = getApplicableConfigurators(config, configurators); subsystems[i] = config.createSubSystem(host, true, interestingPages); // give it the opportunity to create a subsystem i++; } @@ -1798,7 +1796,7 @@ public class SystemRegistry implements ISystemRegistry } } - private ISystemNewConnectionWizardPage[] getApplicableWizardPages(ISubSystemConfiguration ssf, ISystemNewConnectionWizardPage[] allPages) + private ISubSystemConfigurator[] getApplicableConfigurators(ISubSystemConfiguration ssf, ISubSystemConfigurator[] allPages) { if ((allPages == null) || (allPages.length == 0)) return null; @@ -1808,7 +1806,7 @@ public class SystemRegistry implements ISystemRegistry ++count; if (count == 0) return null; - ISystemNewConnectionWizardPage[] subPages = new ISystemNewConnectionWizardPage[count]; + ISubSystemConfigurator[] subPages = new ISubSystemConfigurator[count]; count = 0; for (int idx = 0; idx < allPages.length; idx++) if (allPages[idx].getSubSystemConfiguration() == ssf) diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/RemoteFileSubSystemConfigurationAdapter.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/RemoteFileSubSystemConfigurationAdapter.java index f06278cbce7..fb9b33d253b 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/RemoteFileSubSystemConfigurationAdapter.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/RemoteFileSubSystemConfigurationAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved. + * Copyright (c) 2006, 2008 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 @@ -14,6 +14,7 @@ * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [189123] Move renameSubSystemProfile() from UI to Core + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI ********************************************************************************/ package org.eclipse.rse.internal.files.ui.view; @@ -26,7 +27,6 @@ import org.eclipse.jface.wizard.IWizard; import org.eclipse.rse.core.filters.ISystemFilter; import org.eclipse.rse.core.filters.ISystemFilterPool; import org.eclipse.rse.core.model.ISystemMessageObject; -import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.internal.files.ui.actions.SystemFileUpdateFilterAction; import org.eclipse.rse.internal.files.ui.actions.SystemNewFileAction; @@ -40,6 +40,7 @@ import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.actions.SystemPasteFromClipboardAction; import org.eclipse.rse.ui.view.IContextObject; import org.eclipse.rse.ui.view.SubSystemConfigurationAdapter; +import org.eclipse.rse.ui.wizards.newconnection.ISystemNewConnectionWizardPage; import org.eclipse.swt.dnd.Clipboard; import org.eclipse.swt.widgets.Shell; diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemFileNewConnectionWizardPage.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemFileNewConnectionWizardPage.java index e106e492562..d9c74a4a424 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemFileNewConnectionWizardPage.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards/SystemFileNewConnectionWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2007 IBM Corporation and others. + * Copyright (c) 2002, 2008 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 @@ -12,11 +12,12 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI *******************************************************************************/ package org.eclipse.rse.internal.files.ui.wizards; import org.eclipse.jface.wizard.IWizard; +import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.services.clientserver.messages.SystemMessage; @@ -222,5 +223,12 @@ public class SystemFileNewConnectionWizardPage extends AbstractSystemNewConnecti else return (textPort.getText().trim().length()>0); } + + /* (non-Javadoc) + * @see org.eclipse.rse.core.model.ISystemNewSubSystemProperties#applyValues(org.eclipse.rse.core.subsystems.ISubSystem) + */ + public boolean applyValues(ISubSystem ss) { + return true; + } } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystemConfiguration.java index f2b2bde890e..be0aa9cb8b8 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystemConfiguration.java @@ -18,6 +18,7 @@ * David Dykstal (IBM) - [197036] fixed NPE found during testing * David Dykstal (IBM) - [222270] clean up interfaces in org.eclipse.rse.core.filters * Xuan Chen (IBM) - [223126] [api][breaking] Remove API related to User Actions in RSE Core/UI + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI *******************************************************************************/ package org.eclipse.rse.subsystems.files.core.subsystems; @@ -30,7 +31,7 @@ import org.eclipse.rse.core.filters.ISystemFilter; import org.eclipse.rse.core.filters.ISystemFilterPool; import org.eclipse.rse.core.filters.ISystemFilterPoolManager; import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; +import org.eclipse.rse.core.model.ISubSystemConfigurator; import org.eclipse.rse.core.subsystems.IFileConstants; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.SubSystemConfiguration; @@ -417,12 +418,10 @@ public abstract class RemoteFileSubSystemConfiguration extends SubSystemConfigur /** * Populate a new subsystem with our unique attributes, and/or create default filter references. - * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#initializeSubSystem(ISubSystem,ISystemNewConnectionWizardPage[]) - * @see org.eclipse.rse.ui.view.SubSystemConfigurationAdapter#getNewConnectionWizardPages(org.eclipse.rse.core.subsystems.ISubSystemConfiguration, org.eclipse.jface.wizard.IWizard) */ - protected void initializeSubSystem(ISubSystem ss, ISystemNewConnectionWizardPage[] yourNewConnectionWizardPages) + protected void initializeSubSystem(ISubSystem ss, ISubSystemConfigurator[] configurators) { - super.initializeSubSystem(ss, yourNewConnectionWizardPages); // add a reference to the default filter pool + super.initializeSubSystem(ss, configurators); // add a reference to the default filter pool /** FIXME - decouple wiz pages from core - do we still need this? // Find the "set port" page we contributed to the New Connection wizard, reads it value, and 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 a9e43a45fb6..2b580e95b60 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 @@ -19,6 +19,7 @@ * David McKnight (IBM) - [197129] Removing obsolete ISystemConnectionWizardPropertyPage and SystemSubSystemsPropertiesWizardPage * David Dykstal (IBM) - [217556] remove service subsystem types * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI ********************************************************************************/ package org.eclipse.rse.ui.view; @@ -41,7 +42,7 @@ import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager; import org.eclipse.rse.core.filters.ISystemFilterPoolWrapperInformation; import org.eclipse.rse.core.filters.ISystemFilterReference; import org.eclipse.rse.core.filters.ISystemFilterString; -import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; +import org.eclipse.rse.core.model.ISubSystemConfigurator; import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; @@ -91,6 +92,7 @@ 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.newconnection.ISystemNewConnectionWizardPage; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; @@ -186,7 +188,7 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda *

diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java index ad55117ed5b..d5550f30d2c 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/AbstractSystemNewConnectionWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved. + * Copyright (c) 2002, 2008 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 @@ -14,15 +14,16 @@ * Uwe Stieber (Wind River) - Reworked new connection wizard extension point. * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI ********************************************************************************/ package org.eclipse.rse.ui.wizards; import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.ui.SystemConnectionForm; +import org.eclipse.rse.ui.wizards.newconnection.ISystemNewConnectionWizardPage; import org.eclipse.rse.ui.wizards.newconnection.RSEAbstractNewConnectionWizard; import org.eclipse.rse.ui.wizards.newconnection.RSEDefaultNewConnectionWizardMainPage; import org.eclipse.swt.widgets.Composite; diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SubSystemServiceWizardPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SubSystemServiceWizardPage.java index 2a3dc0168b8..83419baf550 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SubSystemServiceWizardPage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SubSystemServiceWizardPage.java @@ -18,6 +18,7 @@ * Javier Montalvo Orus (Symbian) - [188146] Incorrect "FTP Settings" node in Property Sheet for Linux connection * Martin Oberhuber (Wind River) - [190231] Move ISubSystemPropertiesWizardPage from UI to Core * David Dykstal (IBM) - [217556] remove service subsystem types + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI ********************************************************************************/ package org.eclipse.rse.ui.wizards; @@ -37,7 +38,6 @@ import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.IServerLauncherProperties; 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.ui.widgets.services.ConnectorServiceElement; import org.eclipse.rse.ui.widgets.services.FactoryServiceElement; import org.eclipse.rse.ui.widgets.services.PropertySetServiceElement; @@ -51,7 +51,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizardPage implements ISubSystemPropertiesWizardPage +public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizardPage { private ServicesForm _form; private ISubSystemConfiguration _selectedConfiguration; diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/ISystemNewConnectionWizardPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/ISystemNewConnectionWizardPage.java new file mode 100644 index 00000000000..e2eb26b2337 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/ISystemNewConnectionWizardPage.java @@ -0,0 +1,38 @@ +/********************************************************************************* + * Copyright (c) 2008 IBM Corporation. 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 + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI + *********************************************************************************/ + +package org.eclipse.rse.ui.wizards.newconnection; + +import org.eclipse.rse.core.model.ISubSystemConfigurator; + + +/** + * Interface that all subsystem configuration supplied pages contributed to the New Connection wizard must implement. + * @see org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage + * @see org.eclipse.rse.ui.view.SubSystemConfigurationAdapter#getNewConnectionWizardPages(org.eclipse.rse.core.subsystems.ISubSystemConfiguration, org.eclipse.jface.wizard.IWizard) + */ +public interface ISystemNewConnectionWizardPage extends ISubSystemConfigurator { + + /** + * This is called when the users presses Finish. All that should be done here is validation + * of the input. + * @return true if all is ok and the finish can proceed. + */ + public boolean performFinish(); + + /** + * This is called frequently by the framework to decide whether to enable the Finish and Next buttons. + *

+ * @return true if the page is complete and has no errors. + */ + public boolean isPageComplete(); + +} diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEDefaultNewConnectionWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEDefaultNewConnectionWizard.java index 7895283518f..51f0a2efc6e 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEDefaultNewConnectionWizard.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEDefaultNewConnectionWizard.java @@ -20,6 +20,7 @@ * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods * Uwe Stieber (Wind River) - [192202] Default RSE new connection wizard does not allow to query created host instance anymore * Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI ********************************************************************************/ package org.eclipse.rse.ui.wizards.newconnection; @@ -38,7 +39,6 @@ import org.eclipse.jface.wizard.WizardPage; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java index 8a7af06188f..8c925a35ffc 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java @@ -33,6 +33,7 @@ * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared * Xuan Chen (IBM) - [223126] [api][breaking] Remove API related to User Actions in RSE Core/UI * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types + * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI ********************************************************************************/ package org.eclipse.rse.core.subsystems; @@ -64,7 +65,7 @@ import org.eclipse.rse.core.filters.ISystemFilterString; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ILabeledObject; import org.eclipse.rse.core.model.IRSEPersistableContainer; -import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; +import org.eclipse.rse.core.model.ISubSystemConfigurator; import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfileManager; import org.eclipse.rse.core.model.ISystemRegistry; @@ -108,7 +109,7 @@ import org.eclipse.rse.ui.messages.SystemMessageDialog; *

  • SubSystemConfiguration#getSubSystemActions() if they wish to supply actions for the right-click menu when * the user right clicks on a subsystem object created by this subsystem configuration. *
  • CreateDefaultFilterPool() to create any default filter pool when a new profile is created. - *
  • #initializeSubSystem(SubSystem ss, ISystemNewConnectionWizardPage[]) + *
  • #initializeSubSystem(SubSystem ss, configurarators[]) * *

    * A subsystem configuration will maintain in memory a list of all subsystem objects it has. This @@ -938,20 +939,16 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration * subsystem to manage references to filter pools *

  • if (@link #supportsServerLaunchProperties()}, calls {@link #createServerLauncher(IConnectorService)}, to create * the server launcher instance to associate with this subsystem.}. - *
  • calls {@link #initializeSubSystem(ISubSystem, ISystemNewConnectionWizardPage[])} so subclasses can + *
  • calls {@link #initializeSubSystem(ISubSystem, ISubSystemConfigurator[])} so subclasses can * do their thing to initialize the subsystem. *
  • finally, saves the subsystem to disk. * * @param conn The connection to create a subsystem for * @param creatingConnection true if we are creating a connection, false if just creating * another subsystem for an existing connection. - * @param yourNewConnectionWizardPages The wizard pages you supplied to the New Connection wizard, via the - * {@link org.eclipse.rse.ui.subsystems.ISubSystemConfigurationAdapter#getNewConnectionWizardPages(ISubSystemConfiguration, org.eclipse.jface.wizard.IWizard)} - * method or null if you didn't override this method. - * Note there may be more pages than you originally supplied as it is all pages contributed by - * this subsystem configuration object, including subclasses. + * @param configurators configurators that inject properties into this new subsystem or null if there are none */ - public ISubSystem createSubSystem(IHost conn, boolean creatingConnection, ISystemNewConnectionWizardPage[] yourNewConnectionWizardPages) + public ISubSystem createSubSystem(IHost conn, boolean creatingConnection, ISubSystemConfigurator[] configurators) { invalidateSubSystemCache(conn); // re-gen list of subsystems-by-connection on next call if (creatingConnection) @@ -989,7 +986,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration } } } - initializeSubSystem(subsys, yourNewConnectionWizardPages); + initializeSubSystem(subsys, configurators); try { saveSubSystem(subsys); @@ -1168,33 +1165,16 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration * The default behavior is to add a reference to the default filter pool for this subsystem configuration, * if there is one. Typically subclasses call super().initializeSubSystem(...) * to get this default behavior, then extend it. - * - *

    The reason for the connect wizard pages parameter is in case your subsystem configuration contributes a page to that wizard, - * whose values are needed to set the subsystem's initial state. For example, you might decide to add a - * page to the connection wizard to prompt for a JDBC Driver name. If so, when this method is called at - * the time a new connection is created after the wizard, your page will have the user's value. You can - * thus use it here to initialize that subsystem property. Be use to use instanceof to find your particular - * page. - *

    - * * @param ss - The subsystem that was created via createSubSystemInternal - * @param yourNewConnectionWizardPages - The wizard pages you supplied to the New Connection wizard, via the - * {@link org.eclipse.rse.ui.view.SubSystemConfigurationAdapter#getNewConnectionWizardPages(org.eclipse.rse.core.subsystems.ISubSystemConfiguration, org.eclipse.jface.wizard.IWizard)} - * method or null if you didn't override this method. - * Note there may be more pages than you originally supplied, as you are passed all pages contributed - * by this subsystem configuration object, including subclasses. This is null when this method is called other than - * for a New Connection operation. + * @param configurators an array of {@link ISubSystemConfigurator} used to inject values into this subsystem or null if there are none */ - protected void initializeSubSystem(ISubSystem ss, ISystemNewConnectionWizardPage[] yourNewConnectionWizardPages) - { - if (supportsFilters()) - { + protected void initializeSubSystem(ISubSystem ss, ISubSystemConfigurator[] configurators) { + if (supportsFilters()) { // -------------------------------------------- // add a reference to the default filter pool // -------------------------------------------- ISystemFilterPool pool = getDefaultSystemFilterPool(ss); - if (pool != null) - { + if (pool != null) { ISystemFilterPoolReferenceManager refMgr = ss.getSystemFilterPoolReferenceManager(); refMgr.setProviderEventNotification(false); refMgr.addReferenceToSystemFilterPool(pool); @@ -1202,19 +1182,14 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration } } - // apply properties set in the wizard to the subsystem - if (yourNewConnectionWizardPages != null) - { - ISubSystemPropertiesWizardPage ourPage = null; - for (int idx=0; (ourPage==null) && (idx * Some details: * * Tip: consider extending {@link org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage} for your wizard page class. + * @since 3.0 */ public ISystemNewConnectionWizardPage[] getNewConnectionWizardPages(ISubSystemConfiguration config, IWizard wizard);