1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 07:05:24 +02:00

[189123][api][breaking] Move renameSubSystemProfile() from UI to Core

This commit is contained in:
Martin Oberhuber 2007-05-25 13:08:13 +00:00
parent 922b4d7e89
commit bcc72988f1
5 changed files with 49 additions and 34 deletions

View file

@ -14,6 +14,7 @@
* David Dykstal (IBM) - 168870: move core function from UI to core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util
* Martin Oberhuber (Wind River) - [189123] Move renameSubSystemProfile() from UI to Core
********************************************************************************/
package org.eclipse.rse.core.subsystems;
@ -318,6 +319,23 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
*/
public ISystemProfile getSystemProfile(ISystemFilterPool pool);
/**
* Callback method called after renaming a subsystem profile.
* <p>
* This is called by SystemRegistry's renameSystemProfile method
* after it is complete, , in order to allow the subsystem configuration
* perform any required cleanup. For instance, subsystem configurations
* must ensure that they update their filter pool manager names
* (and their folders).
* </p><p>
* Must be called AFTER changing the profile's name!!
* </p>
* @param oldProfileName the old profile name.
* @param newProfileName the new profile name.
*/
public void renameSubSystemProfile(String oldProfileName, String newProfileName);
// ---------------------------------
// SUBSYSTEM METHODS...
// ---------------------------------

View file

@ -13,6 +13,7 @@
* Contributors:
* Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [189123] Move renameSubSystemProfile() from UI to Core
********************************************************************************/
package org.eclipse.rse.ui.view;
@ -1210,34 +1211,6 @@ public class SubSystemConfigurationAdapter implements ISubSystemConfigurationAda
return new RemoteServerLauncherForm(shell, msgLine);
}
/**
* Called by SystemRegistry's renameSystemProfile method to ensure we update our
* filter pool manager names (and their folders)
* <p>
* Must be called AFTER changing the profile's name!!
*/
public void renameSubSystemProfile(ISubSystemConfiguration factory, String oldProfileName, String newProfileName)
{
//RSEUIPlugin.logDebugMessage(this.getClass().getName(), "Inside renameSubSystemProfile. newProfileName = "+newProfileName);
ISystemProfile profile = factory.getSystemProfile(newProfileName);
factory.renameFilterPoolManager(profile); // update filter pool manager name
//if (profile.isDefaultPrivate()) // I don't remember why this was here, but it caused bad things, Phil.
{
// Rename the default filter pool for this profile, as it's name is derived from the profile.
ISystemFilterPool defaultPoolForThisProfile = factory.getDefaultFilterPool(profile, oldProfileName);
if (defaultPoolForThisProfile != null)
try
{
factory.getFilterPoolManager(profile).renameSystemFilterPool(defaultPoolForThisProfile, SubSystemConfiguration.getDefaultFilterPoolName(newProfileName, factory.getId()));
}
catch (Exception exc)
{
SystemBasePlugin.logError("Unexpected error renaming default filter pool " + SubSystemConfiguration.getDefaultFilterPoolName(newProfileName, factory.getId()), exc); //$NON-NLS-1$
System.out.println("Unexpected error renaming default filter pool " + SubSystemConfiguration.getDefaultFilterPoolName(newProfileName, factory.getId()) + ": " + exc); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
/**
* Return the validator for the password which is prompted for at runtime.
* Returns null by default.

View file

@ -28,6 +28,7 @@
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
* Martin Oberhuber (Wind River) - [186773] split SystemRegistryUI from SystemRegistry implementation
* Martin Oberhuber (Wind River) - [189123] Prepare ISystemRegistry for move into non-UI
* Martin Oberhuber (Wind River) - [189123] Move renameSubSystemProfile() from UI to Core
********************************************************************************/
package org.eclipse.rse.ui.internal.model;
@ -90,7 +91,6 @@ import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.rse.ui.SystemPreferencesManager;
import org.eclipse.rse.ui.messages.SystemMessageDialog;
import org.eclipse.rse.ui.subsystems.ISubSystemConfigurationAdapter;
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
import org.eclipse.rse.ui.view.SystemAdapterHelpers;
import org.eclipse.swt.widgets.Display;
@ -609,9 +609,7 @@ public class SystemRegistry implements ISystemRegistry
ISubSystemConfiguration factory = proxies[idx].getSubSystemConfiguration();
if (factory != null)
{
//FIXME why is this done via the adapter, and not the ISubSystemConfiguration directly?
ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)factory.getAdapter(ISubSystemConfigurationAdapter.class);
adapter.renameSubSystemProfile(factory,oldName, newName);
factory.renameSubSystemProfile(oldName, newName);
}
}
}

View file

@ -20,6 +20,7 @@
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [189123] Move renameSubSystemProfile() from UI to Core
********************************************************************************/
package org.eclipse.rse.core.subsystems;
@ -829,6 +830,32 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
}
}
/*
* (non-Javadoc)
* @see org.eclipse.rse.core.subsystems.ISubSystemConfiguration#renameSubSystemProfile(java.lang.String, java.lang.String)
*/
public void renameSubSystemProfile(String oldProfileName, String newProfileName)
{
//RSEUIPlugin.logDebugMessage(this.getClass().getName(), "Inside renameSubSystemProfile. newProfileName = "+newProfileName);
ISystemProfile profile = getSystemProfile(newProfileName);
renameFilterPoolManager(profile); // update filter pool manager name
//if (profile.isDefaultPrivate()) // I don't remember why this was here, but it caused bad things, Phil.
{
// Rename the default filter pool for this profile, as it's name is derived from the profile.
ISystemFilterPool defaultPoolForThisProfile = getDefaultFilterPool(profile, oldProfileName);
if (defaultPoolForThisProfile != null)
try
{
getFilterPoolManager(profile).renameSystemFilterPool(defaultPoolForThisProfile, SubSystemConfiguration.getDefaultFilterPoolName(newProfileName, getId()));
}
catch (Exception exc)
{
SystemBasePlugin.logError("Unexpected error renaming default filter pool " + SubSystemConfiguration.getDefaultFilterPoolName(newProfileName, getId()), exc); //$NON-NLS-1$
System.out.println("Unexpected error renaming default filter pool " + SubSystemConfiguration.getDefaultFilterPoolName(newProfileName, getId()) + ": " + exc); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
// ---------------------------------
// SUBSYSTEM METHODS...
// ---------------------------------

View file

@ -12,6 +12,7 @@
*
* Contributors:
* Martin Oberhuber (Wind River) - [186748] Move from UI/org.eclipse.rse.core.subsystems.util
* Martin Oberhuber (Wind River) - [189123] Move renameSubSystemProfile() from UI to Core
********************************************************************************/
package org.eclipse.rse.ui.subsystems;
@ -282,8 +283,6 @@ public interface ISubSystemConfigurationAdapter
*/
public ImageDescriptor getSystemFilterStringImage(String filterStringString);
public void renameSubSystemProfile(ISubSystemConfiguration config, String oldProfileName, String newProfileName);
/**
* Return the single property page to show in the tabbed notebook for the
* for SubSystem property of the parent Connection. Return null if no