From b8e845710ce20a19833ac8c66e3bd6dab6046f30 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Thu, 3 Apr 2008 17:18:11 +0000 Subject: [PATCH] [225506] [api][breaking] RSE UI leaks non-API types -removing SystemAdapterHelpers.getSystemViewAdapterFactory() --- .../rse/internal/ui/view/team/SystemTeamViewPart.java | 6 ++++-- .../org/eclipse/rse/ui/view/SystemAdapterHelpers.java | 10 +--------- 2 files changed, 5 insertions(+), 11 deletions(-) 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 3657b7dcec8..8ae6413f4a4 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 @@ -20,6 +20,7 @@ * 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 * David Dykstal (IBM) - [202630] getDefaultPrivateProfile() and ensureDefaultPrivateProfile() are inconsistent + * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types ********************************************************************************/ package org.eclipse.rse.internal.ui.view.team; @@ -155,7 +156,6 @@ public class SystemTeamViewPart protected SystemTeamViewRefreshAllAction toolBarRefreshAllAction, menuRefreshAllAction; protected SystemCollapseAllAction collapseAllAction; - protected ISystemViewElementAdapter profileAdapter = RSEUIPlugin.getDefault().getSystemViewAdapterFactory().getProfileAdapter(); // remember-state variables... private IMemento fMemento; @@ -1425,7 +1425,9 @@ public class SystemTeamViewPart break; case 3: if (profile != null) { - SystemTeamViewProfileAdapter profileAdapter = (SystemTeamViewProfileAdapter) RSEUIPlugin.getDefault().getSystemViewAdapterFactory().getAdapter(profile, SystemTeamViewProfileAdapter.class); + + + SystemTeamViewProfileAdapter profileAdapter = (SystemTeamViewProfileAdapter)((IAdaptable)profile).getAdapter(ISystemViewElementAdapter.class); category = profileAdapter.restoreCategory(profile, token); } //System.out.println("Restored category: "+(category==null?"null":category.getLabel())); diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemAdapterHelpers.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemAdapterHelpers.java index f7d21fb8c70..a7b7db24d67 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemAdapterHelpers.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemAdapterHelpers.java @@ -14,6 +14,7 @@ * Uwe Stieber (Wind River) - [174418] SystemAdapterHelpers.getViewAdapter(Object) try to find adapter twice * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin * Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core + * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types ********************************************************************************/ package org.eclipse.rse.ui.view; @@ -22,8 +23,6 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.Platform; import org.eclipse.jface.viewers.Viewer; import org.eclipse.rse.core.model.ISystemViewInputProvider; -import org.eclipse.rse.internal.ui.view.SystemViewAdapterFactory; -import org.eclipse.rse.ui.RSEUIPlugin; /** @@ -109,11 +108,4 @@ public class SystemAdapterHelpers { ((ISystemViewElementAdapter)adapter).setViewer(viewer); return adapter; } - - /** - * For pathpath access to our adapters for non-local objects in our model. Exploits the knowledge we use singleton adapters. - */ - public static SystemViewAdapterFactory getSystemViewAdapterFactory() { - return RSEUIPlugin.getDefault().getSystemViewAdapterFactory(); - } } \ No newline at end of file