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

[cleanup] Avoid using SystemStartHere in production code

This commit is contained in:
Martin Oberhuber 2008-02-12 18:57:20 +00:00
parent dbab11d6bc
commit ee4235691c
9 changed files with 40 additions and 34 deletions

View file

@ -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
@ -16,14 +16,15 @@
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
* Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code
********************************************************************************/
package org.eclipse.rse.core.model;
import org.eclipse.rse.core.IRSECoreRegistry;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.core.model.SystemProfileManager;
/**
@ -55,8 +56,8 @@ public class SystemStartHere
/**
* STEP 2b. Get all connections for the given system type.
* <p>
* SAME AS: <code>getSystemRegistry().getConnectionsBySystemType(systemType)</code>
* @param systemType One of the system types defined via system type extension point:
* SAME AS: <code>getSystemRegistry().getHostsBySystemType(systemType)</code>
* @param systemTypeId One of the system types IDs defined via system type extension point:
* <ul>
* <li>"org.eclipse.rse.systemtype.iseries" ({@link IRSESystemType#SYSTEMTYPE_ISERIES_ID})
* <li>"org.eclipse.rse.systemtype.windows" ({@link IRSESystemType#SYSTEMTYPE_WINDOWS_ID})
@ -65,12 +66,13 @@ public class SystemStartHere
* <li>"org.eclipse.rse.systemtype.linux" ({@link IRSESystemType#SYSTEMTYPE_LINUX_ID})
* <li>"org.eclipse.rse.systemtype.aix" ({@link IRSESystemType#SYSTEMTYPE_AIX_ID})
* <li>"org.eclipse.rse.systemtype.local" ({@link IRSESystemType#SYSTEMTYPE_LOCAL_ID})
* <li>"org.eclipse.rse.systemtype.ftp" ({@link IRSESystemType#SYSTEMTYPE_FTP_ID})
* <li>"org.eclipse.rse.systemtype.ssh" ({@link IRSESystemType#SYSTEMTYPE_SSH_ID})
* <li>"org.eclipse.rse.systemtype.telnet" ({@link IRSESystemType#SYSTEMTYPE_TELNET_ID})
* <li>"org.eclipse.rse.systemtype.ftp" ({@link IRSESystemType#SYSTEMTYPE_FTP_ONLY_ID})
* <li>"org.eclipse.rse.systemtype.ssh" ({@link IRSESystemType#SYSTEMTYPE_SSH_ONLY_ID})
* <li>"org.eclipse.rse.systemtype.telnet" ({@link IRSESystemType#SYSTEMTYPE_TELNET_ONLY_ID})
* </ul>
* @see org.eclipse.rse.core.IRSESystemType
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySystemType(String)
* @see IRSECoreRegistry#getSystemTypeById(String)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySystemType(IRSESystemType)
*
*/
public static IHost[] getConnectionsBySystemType(String systemTypeId)
@ -161,7 +163,7 @@ public class SystemStartHere
// MISCELLANEOUS:
// ----------------------------
/**
* Miscallenous Helper. Return the subsystem configuration object for the given subsystemConfigurationId.
* Miscellaneous Helper - return the subsystem configuration object for the given subsystemConfigurationId.
* <p>
* SAME AS: <code>getSystemRegistry().getSubSystemConfiguration(subsystemConfigurationId)</code>
* @param subsystemConfigurationId The id of the subsystem configuration as given in its plugin.xml id attribute for the subsystemConfigurations extension point
@ -172,12 +174,12 @@ public class SystemStartHere
}
/**
* Miscellaneous Helper. Return singleton profile manager
* Miscellaneous Helper - Return the singleton profile manager.
* SAME AS: <code>getSystemRegistry().getSystemProfileManager()</code>
*/
public static ISystemProfileManager getSystemProfileManager()
{
return SystemProfileManager.getDefault();
return RSECorePlugin.getTheSystemProfileManager();
}
/**

View file

@ -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,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code
*******************************************************************************/
package org.eclipse.rse.internal.ui.actions;
@ -81,7 +81,7 @@ public class SystemNewProfileAction extends SystemBaseWizardAction {
* connection was created. However, new default profiles are created when RSE is initially activated
* so there is no need to inhibit profile creation.
*/
// ISystemProfile defaultProfile = SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile();
// ISystemProfile defaultProfile = RSECorePlugin.getTheSystemProfileManager().getDefaultPrivateSystemProfile();
// if (defaultProfile != null)
// return false;
// else

View file

@ -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
@ -18,6 +18,7 @@
* API to the user actions plugin
* Rupen Mardirossian (IBM) - [187741] Implemented the handleDoubleClick method
* Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread
* Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code
********************************************************************************/
package org.eclipse.rse.internal.ui.view.team;
@ -73,7 +74,6 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.ISystemProfileManager;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.ui.actions.SystemCollapseAllAction;
@ -680,7 +680,7 @@ public class SystemTeamViewPart
*/
private SystemTeamReloadAction getReloadRSEAction(IStructuredSelection selection)
{
boolean privateProfileStillExists = (SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile() != null);
boolean privateProfileStillExists = (RSECorePlugin.getTheSystemProfileManager().getDefaultPrivateSystemProfile() != null);
if (reloadRSEAction == null)
reloadRSEAction = new SystemTeamReloadAction(getShell());
reloadRSEAction.setSelection(selection);
@ -757,7 +757,7 @@ public class SystemTeamViewPart
IStructuredSelection selection = getStructuredSelection();
Object firstSelection = selection.getFirstElement();
if (firstSelection instanceof IProject) {
boolean privateProfileStillExists = (SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile() != null);
boolean privateProfileStillExists = (RSECorePlugin.getTheSystemProfileManager().getDefaultPrivateSystemProfile() != null);
IContributionItem items[] = menuMgr.getItems();
if (items != null) {
for (int idx = 0; idx < items.length; idx++) {

View file

@ -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
@ -19,6 +19,7 @@
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* David Dykstal (IBM) - [191130] use new getRemoteSystemsProject(boolean) call
* Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread
* Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code
********************************************************************************/
package org.eclipse.rse.internal.ui.view.team;
@ -33,7 +34,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.SystemResourceManager;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.ui.actions.SystemCommonDeleteAction;
import org.eclipse.rse.internal.ui.actions.SystemCommonRenameAction;
@ -89,7 +89,7 @@ public class SystemTeamViewProfileAdapter
if (!actionsCreated)
createActions();
boolean privateProfileStillExists = (SystemStartHere.getSystemProfileManager().getDefaultPrivateSystemProfile() != null);
boolean privateProfileStillExists = (RSECorePlugin.getTheSystemProfileManager().getDefaultPrivateSystemProfile() != null);
copyProfileAction.setProfile((ISystemProfile)selection.getFirstElement());
if (activeProfileAction != null)

View file

@ -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
@ -13,6 +13,7 @@
* Contributors:
* Uwe Stieber (Wind River) - API consistency.
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code
********************************************************************************/
package org.eclipse.rse.ui.dialogs;
@ -32,6 +33,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.jface.wizard.ProgressMonitorPart;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.ui.dialogs.SystemControlEnableState;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
@ -897,7 +899,7 @@ public abstract class SystemPromptDialog
/**
* Swing-like method to auto-set the size of this dialog by
* looking at the preferred sizes of all constituents.
* looking at the preferred sizes of all constituents.
* @deprecated
*/
protected void pack()
@ -1159,7 +1161,7 @@ public abstract class SystemPromptDialog
separator= new Label(parentComposite, SWT.HORIZONTAL | SWT.SEPARATOR);
separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
if (RSEUIPlugin.isTheSystemRegistryActive())
if (RSECorePlugin.isTheSystemRegistryActive())
{
RSEUIPlugin.getTheSystemRegistryUI().setRunnableContext(getShell(),this);
// add a dispose listener for the shell

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. 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
@ -13,6 +13,7 @@
* Contributors:
* Uwe Stieber (Wind River) - API consistency.
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code
********************************************************************************/
package org.eclipse.rse.ui.dialogs;
@ -21,6 +22,7 @@ import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.ProgressMonitorPart;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.wizards.ISystemWizard;
import org.eclipse.swt.events.DisposeEvent;
@ -144,7 +146,7 @@ public class SystemWizardDialog extends WizardDialog implements ISystemPromptDia
IProgressMonitor pm = getProgressMonitor();
((ProgressMonitorPart)pm).dispose();
}
if (needsMonitor && RSEUIPlugin.isTheSystemRegistryActive()) {
if (needsMonitor && RSECorePlugin.isTheSystemRegistryActive()) {
RSEUIPlugin.getTheSystemRegistryUI().setRunnableContext(getShell(), this);
// add a dispose listener
getShell().addDisposeListener(new DisposeListener() {

View file

@ -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,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code
*******************************************************************************/
package org.eclipse.rse.ui.validators;
@ -67,7 +67,7 @@ public class ValidatorConnectionName extends ValidatorUniqueString implements IS
for (int idx = 0; (msg == null) && (idx < names.length); idx++)
{
profileName = names[idx];
IHost[] conns = RSEUIPlugin.getTheSystemProfileManager().getSystemProfile(profileName).getHosts();
IHost[] conns = RSECorePlugin.getTheSystemProfileManager().getSystemProfile(profileName).getHosts();
for (int jdx=0; (msg==null) && (jdx<conns.length); jdx++)
{
if (conns[jdx].getAliasName().equalsIgnoreCase(proposedName))

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others. All rights reserved.
* Copyright (c) 2000, 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
@ -19,6 +19,7 @@
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* 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
********************************************************************************/
package org.eclipse.rse.ui.wizards.newconnection;
@ -40,7 +41,6 @@ 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.model.SystemStartHere;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.ui.SystemResources;
@ -76,7 +76,7 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
* Constructor.
*/
public RSEDefaultNewConnectionWizard() {
String[] profiles = SystemStartHere.getSystemProfileManager().getActiveSystemProfileNames();
String[] profiles = RSECorePlugin.getTheSystemProfileManager().getActiveSystemProfileNames();
// normalize the profiles by sorting our null or empty profile names
List normalized = new LinkedList();
for (int i = 0; i < profiles.length; i++) {

View file

@ -28,6 +28,7 @@
* David Dykstal (IBM) - [197036] rewrote getFilterPoolManager to delay the creation of default filter pools until the corresponding
* a subsystem configuration is actually used for a host.
* David Dykstal (IBM) - [217556] remove service subsystem types
* Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code
********************************************************************************/
package org.eclipse.rse.core.subsystems;
@ -61,7 +62,6 @@ import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.ISystemProfileManager;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.internal.core.filters.SystemFilterPoolManager;
@ -2585,7 +2585,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
*/
public ISystemFilterPoolManager[] getAllSystemFilterPoolManagers()
{
ISystemProfile[] profiles = SystemStartHere.getSystemProfileManager().getSystemProfiles();
ISystemProfile[] profiles = RSECorePlugin.getTheSystemProfileManager().getSystemProfiles();
ISystemFilterPoolManager[] allMgrs = new ISystemFilterPoolManager[profiles.length];
for (int idx = 0; idx < profiles.length; idx++)
{