From ee4235691c044f7f7fb288a62004030bdb63e31c Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Tue, 12 Feb 2008 18:57:20 +0000 Subject: [PATCH] [cleanup] Avoid using SystemStartHere in production code --- .../rse/core/model/SystemStartHere.java | 24 ++++++++++--------- .../ui/actions/SystemNewProfileAction.java | 6 ++--- .../ui/view/team/SystemTeamViewPart.java | 8 +++---- .../team/SystemTeamViewProfileAdapter.java | 6 ++--- .../rse/ui/dialogs/SystemPromptDialog.java | 8 ++++--- .../rse/ui/dialogs/SystemWizardDialog.java | 6 +++-- .../validators/ValidatorConnectionName.java | 6 ++--- .../RSEDefaultNewConnectionWizard.java | 6 ++--- .../subsystems/SubSystemConfiguration.java | 4 ++-- 9 files changed, 40 insertions(+), 34 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemStartHere.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemStartHere.java index 365aa2a39ea..609ddf1a516 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemStartHere.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemStartHere.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 @@ -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. *
- * SAME AS: getSystemRegistry().getConnectionsBySystemType(systemType)
- * @param systemType One of the system types defined via system type extension point:
+ * SAME AS: getSystemRegistry().getHostsBySystemType(systemType)
+ * @param systemTypeId One of the system types IDs defined via system type extension point:
*
* SAME AS: getSystemRegistry().getSubSystemConfiguration(subsystemConfigurationId)
* @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: getSystemRegistry().getSystemProfileManager()
*/
public static ISystemProfileManager getSystemProfileManager()
{
- return SystemProfileManager.getDefault();
+ return RSECorePlugin.getTheSystemProfileManager();
}
/**
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemNewProfileAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemNewProfileAction.java
index 2ba9a4f872e..746fb89d48b 100644
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemNewProfileAction.java
+++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemNewProfileAction.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,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
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewPart.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewPart.java
index 6864ff79ef4..a26b19a51f5 100644
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewPart.java
+++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewPart.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
@@ -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++) {
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewProfileAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewProfileAdapter.java
index 0582cd2684f..1aed035b5df 100644
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewProfileAdapter.java
+++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewProfileAdapter.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
@@ -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)
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPromptDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPromptDialog.java
index 385dd1dbbc6..5cd1a2e8878 100644
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPromptDialog.java
+++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPromptDialog.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
@@ -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
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWizardDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWizardDialog.java
index 5eb92f75dc1..7df9ba5eca2 100644
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWizardDialog.java
+++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemWizardDialog.java
@@ -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() {
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.java
index 1c7fc1d34c5..3f47dd218ff 100644
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.java
+++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.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,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