### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.ui Index: UI/org/eclipse/rse/ui/view/SystemResourceSelectionInputProvider.java =================================================================== RCS file: UI/org/eclipse/rse/ui/view/SystemResourceSelectionInputProvider.java diff -N UI/org/eclipse/rse/ui/view/SystemResourceSelectionInputProvider.java --- UI/org/eclipse/rse/ui/view/SystemResourceSelectionInputProvider.java 5 Apr 2008 17:47:20 -0000 1.6 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,143 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2004, 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: - * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType - * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry - * Martin Oberhuber (Wind River) - [202866] Fix exceptions in RSE browse dialog when SystemRegistry is not yet fully initialized - * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types - ********************************************************************************/ - -package org.eclipse.rse.ui.view; -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.ISystemRegistry; -import org.eclipse.rse.core.subsystems.ISubSystem; - - -public abstract class SystemResourceSelectionInputProvider extends SystemAbstractAPIProvider -{ - private IHost _connection = null; - private boolean _onlyConnection = false; - private boolean _allowNew = true; - private IRSESystemType[] _systemTypes; - private String _category = null; - - public SystemResourceSelectionInputProvider(IHost connection) - { - _connection = connection; - } - - public SystemResourceSelectionInputProvider() - { - // choose random host - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - IHost[] hosts = registry.getHosts(); - if (hosts != null && hosts.length>0) { - _connection = hosts[0]; - } - } - - public IHost getSystemConnection() - { - return _connection; - } - - public boolean allowMultipleConnections() - { - return !_onlyConnection; - } - - public void setAllowNewConnection(boolean flag) - { - _allowNew = flag; - } - - public boolean allowNewConnection() - { - return _allowNew; - } - - public void setSystemConnection(IHost connection, boolean onlyConnection) - { - _connection = connection; - _onlyConnection = onlyConnection; - } - - public IRSESystemType[] getSystemTypes() - { - return _systemTypes; - } - - public void setSystemTypes(IRSESystemType[] types) - { - _systemTypes = types; - } - - public Object[] getSystemViewRoots() - { - if (_connection == null) - { - ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); - IHost[] hosts = registry.getHosts(); - if (hosts!=null && hosts.length!=0) { - _connection = registry.getHosts()[0]; - } - } - return getConnectionChildren(_connection); - } - - public boolean hasSystemViewRoots() - { - return false; - } - - public Object[] getConnectionChildren(IHost selectedConnection) - { - if (selectedConnection != null) - { - ISubSystem ss = getSubSystem(selectedConnection); - if (ss!=null) { - return ss.getChildren(); - } - } - return new Object[0]; - } - - public boolean hasConnectionChildren(IHost selectedConnection) - { - if (selectedConnection != null) - { - ISubSystem ss = getSubSystem(selectedConnection); - if (ss!=null) { - return ss.hasChildren(); - } - } - return false; - } - - protected abstract ISubSystem getSubSystem(IHost selectedConnection); - - - public void setCategory(String category) - { - _category = category; - } - - public String getCategory() - { - return _category; - } - - -} \ No newline at end of file Index: UI/org/eclipse/rse/internal/ui/view/SystemResourceSelectionForm.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemResourceSelectionForm.java,v retrieving revision 1.11 diff -u -r1.11 SystemResourceSelectionForm.java --- UI/org/eclipse/rse/internal/ui/view/SystemResourceSelectionForm.java 5 Apr 2008 17:47:19 -0000 1.11 +++ UI/org/eclipse/rse/internal/ui/view/SystemResourceSelectionForm.java 7 Apr 2008 16:57:15 -0000 @@ -44,10 +44,10 @@ import org.eclipse.rse.ui.messages.ISystemMessageLine; import org.eclipse.rse.ui.validators.IValidatorRemoteSelection; import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter; +import org.eclipse.rse.ui.view.ISystemResourceSelectionInputProvider; import org.eclipse.rse.ui.view.ISystemTree; import org.eclipse.rse.ui.view.ISystemViewElementAdapter; import org.eclipse.rse.ui.view.SystemAdapterHelpers; -import org.eclipse.rse.ui.view.SystemResourceSelectionInputProvider; import org.eclipse.rse.ui.widgets.SystemHostCombo; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; @@ -67,8 +67,8 @@ private Shell _shell; private boolean _multipleSelection = true; protected static final int PROMPT_WIDTH = 400; // The maximum width of the dialog's prompt, in pixels. - - private SystemResourceSelectionInputProvider _inputProvider; + + private ISystemResourceSelectionInputProvider _inputProvider; private SystemHostCombo _connectionCombo; private SystemViewForm _systemViewForm; private Composite _propertySheetContainer; @@ -98,7 +98,8 @@ public SystemResourceSelectionForm(Shell shell, Composite parent, Object caller, - SystemResourceSelectionInputProvider inputProvider, String verbiage, + ISystemResourceSelectionInputProvider inputProvider, + String verbiage, boolean multipleSelection, ISystemMessageLine msgLine) { Index: UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java,v retrieving revision 1.15 diff -u -r1.15 SystemRemoteResourceDialog.java --- UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java 5 Apr 2008 17:47:24 -0000 1.15 +++ UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java 7 Apr 2008 16:57:15 -0000 @@ -27,8 +27,8 @@ import org.eclipse.rse.ui.SystemActionViewerFilter; import org.eclipse.rse.ui.messages.ISystemMessageLine; import org.eclipse.rse.ui.validators.IValidatorRemoteSelection; +import org.eclipse.rse.ui.view.ISystemResourceSelectionInputProvider; import org.eclipse.rse.ui.view.ISystemTree; -import org.eclipse.rse.ui.view.SystemResourceSelectionInputProvider; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; @@ -37,7 +37,7 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog { private SystemResourceSelectionForm _form; - private SystemResourceSelectionInputProvider _inputProvider; + private ISystemResourceSelectionInputProvider _inputProvider; private Object _preSelection; private IValidatorRemoteSelection _selectionValidator; private boolean _multipleSelectionMode; @@ -47,7 +47,8 @@ private String _message, _tip; - public SystemRemoteResourceDialog(Shell shell, String title, SystemResourceSelectionInputProvider inputProvider) + public SystemRemoteResourceDialog(Shell shell, String title, + ISystemResourceSelectionInputProvider inputProvider) { super(shell, title); _inputProvider = inputProvider; Index: UI/org/eclipse/rse/ui/view/ISystemResourceSelectionInputProvider.java =================================================================== RCS file: UI/org/eclipse/rse/ui/view/ISystemResourceSelectionInputProvider.java diff -N UI/org/eclipse/rse/ui/view/ISystemResourceSelectionInputProvider.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ UI/org/eclipse/rse/ui/view/ISystemResourceSelectionInputProvider.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,80 @@ +/******************************************************************************** + * 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 + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight. + * + * Contributors: + * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types + ********************************************************************************/ +package org.eclipse.rse.ui.view; + +import org.eclipse.rse.core.IRSESystemType; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemViewInputProvider; + +/** + * Public interface for the system resource selection input provider + * that is used in the SystemRemoteResourceDialog and the + * SystemResourceSelectionForm + * + */ +public interface ISystemResourceSelectionInputProvider + extends ISystemViewInputProvider +{ + /** + * Gets the associated system connection + * @return the system connection + */ + public IHost getSystemConnection(); + + /** + * Indicates whether the input provider should allow new connections + * to be created. + * @param flag whether new connections should be allowed + */ + public void setAllowNewConnection(boolean flag); + + /** + * Returns whether multiple connections can be displayed via the + * input provider + * @return true if multiple connections are allowed + */ + public boolean allowMultipleConnections(); + + /** + * Returns whether new connections can be created from the view + * using this input provider. + * @return true if new connections are allowed. + */ + public boolean allowNewConnection(); + + /** + * Returns the category for the view using the input provider (i.e. "files") + * @return the category + */ + public String getCategory(); + + /** + * Sets the system types allowed for this input provider + * @param types the types of systems + */ + public void setSystemTypes(IRSESystemType[] types); + + /** + * Gets the system types allowed for the associated control + * @return the system types + */ + public IRSESystemType[] getSystemTypes(); + + /** + * Sets the associated system connection for the input provider + * @param connection the connection + * @param onlyConnection whether other connections are allowed + */ + public void setSystemConnection(IHost connection, boolean onlyConnection); +} Index: UI/org/eclipse/rse/internal/ui/view/SystemResourceSelectionInputProvider.java =================================================================== RCS file: UI/org/eclipse/rse/internal/ui/view/SystemResourceSelectionInputProvider.java diff -N UI/org/eclipse/rse/internal/ui/view/SystemResourceSelectionInputProvider.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ UI/org/eclipse/rse/internal/ui/view/SystemResourceSelectionInputProvider.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,146 @@ +/******************************************************************************** + * Copyright (c) 2004, 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: + * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType + * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [202866] Fix exceptions in RSE browse dialog when SystemRegistry is not yet fully initialized + * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types + ********************************************************************************/ + +package org.eclipse.rse.internal.ui.view; +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.ISystemRegistry; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.ui.view.ISystemResourceSelectionInputProvider; +import org.eclipse.rse.ui.view.SystemAbstractAPIProvider; + + +public abstract class SystemResourceSelectionInputProvider extends SystemAbstractAPIProvider + implements ISystemResourceSelectionInputProvider +{ + private IHost _connection = null; + private boolean _onlyConnection = false; + private boolean _allowNew = true; + private IRSESystemType[] _systemTypes; + private String _category = null; + + public SystemResourceSelectionInputProvider(IHost connection) + { + _connection = connection; + } + + public SystemResourceSelectionInputProvider() + { + // choose random host + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + IHost[] hosts = registry.getHosts(); + if (hosts != null && hosts.length>0) { + _connection = hosts[0]; + } + } + + public IHost getSystemConnection() + { + return _connection; + } + + public boolean allowMultipleConnections() + { + return !_onlyConnection; + } + + public void setAllowNewConnection(boolean flag) + { + _allowNew = flag; + } + + public boolean allowNewConnection() + { + return _allowNew; + } + + public void setSystemConnection(IHost connection, boolean onlyConnection) + { + _connection = connection; + _onlyConnection = onlyConnection; + } + + public IRSESystemType[] getSystemTypes() + { + return _systemTypes; + } + + public void setSystemTypes(IRSESystemType[] types) + { + _systemTypes = types; + } + + public Object[] getSystemViewRoots() + { + if (_connection == null) + { + ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); + IHost[] hosts = registry.getHosts(); + if (hosts!=null && hosts.length!=0) { + _connection = registry.getHosts()[0]; + } + } + return getConnectionChildren(_connection); + } + + public boolean hasSystemViewRoots() + { + return false; + } + + public Object[] getConnectionChildren(IHost selectedConnection) + { + if (selectedConnection != null) + { + ISubSystem ss = getSubSystem(selectedConnection); + if (ss!=null) { + return ss.getChildren(); + } + } + return new Object[0]; + } + + public boolean hasConnectionChildren(IHost selectedConnection) + { + if (selectedConnection != null) + { + ISubSystem ss = getSubSystem(selectedConnection); + if (ss!=null) { + return ss.hasChildren(); + } + } + return false; + } + + protected abstract ISubSystem getSubSystem(IHost selectedConnection); + + + public void setCategory(String category) + { + _category = category; + } + + public String getCategory() + { + return _category; + } + + +} #P org.eclipse.rse.files.ui Index: src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFileOrFolderForm.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFileOrFolderForm.java,v retrieving revision 1.20 diff -u -r1.20 SystemSelectRemoteFileOrFolderForm.java --- src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFileOrFolderForm.java 5 Apr 2008 17:47:35 -0000 1.20 +++ src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFileOrFolderForm.java 7 Apr 2008 16:57:16 -0000 @@ -198,7 +198,7 @@ * Returns the input provider that drives the contents of the tree * Subclasses can override to provide custom tree contents */ - protected ISystemSelectRemoteObjectAPIProvider getInputProvider() + private ISystemSelectRemoteObjectAPIProvider getInputProvider() { if (inputProvider == null) { Index: src/org/eclipse/rse/files/ui/dialogs/SystemRemoteFileSelectionInputProvider.java =================================================================== RCS file: src/org/eclipse/rse/files/ui/dialogs/SystemRemoteFileSelectionInputProvider.java diff -N src/org/eclipse/rse/files/ui/dialogs/SystemRemoteFileSelectionInputProvider.java --- src/org/eclipse/rse/files/ui/dialogs/SystemRemoteFileSelectionInputProvider.java 5 Apr 2008 17:47:35 -0000 1.7 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,47 +0,0 @@ -/******************************************************************************* - * 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 - * - * 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 McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types - *******************************************************************************/ - -package org.eclipse.rse.files.ui.dialogs; - -import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; -import org.eclipse.rse.ui.view.SystemResourceSelectionInputProvider; - - -public class SystemRemoteFileSelectionInputProvider extends - SystemResourceSelectionInputProvider -{ - - public SystemRemoteFileSelectionInputProvider(IHost connection) - { - super(connection); - setCategory("files"); //$NON-NLS-1$ - } - - public SystemRemoteFileSelectionInputProvider() - { - super(); - setCategory("files"); //$NON-NLS-1$ - } - - protected ISubSystem getSubSystem(IHost selectedConnection) - { - return RemoteFileUtility.getFileSubSystem(selectedConnection); - } - -} Index: src/org/eclipse/rse/files/ui/dialogs/SystemRemoteFileDialog.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/dialogs/SystemRemoteFileDialog.java,v retrieving revision 1.9 diff -u -r1.9 SystemRemoteFileDialog.java --- src/org/eclipse/rse/files/ui/dialogs/SystemRemoteFileDialog.java 5 Apr 2008 17:47:35 -0000 1.9 +++ src/org/eclipse/rse/files/ui/dialogs/SystemRemoteFileDialog.java 7 Apr 2008 16:57:16 -0000 @@ -23,6 +23,7 @@ import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.internal.files.ui.view.SystemRemoteFileSelectionInputProvider; import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources; import org.eclipse.rse.ui.SystemActionViewerFilter; import org.eclipse.rse.ui.dialogs.SystemRemoteResourceDialog; Index: src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderForm.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderForm.java,v retrieving revision 1.2 diff -u -r1.2 SystemSearchRemoteFolderForm.java --- src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderForm.java 5 Apr 2008 17:47:34 -0000 1.2 +++ src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderForm.java 7 Apr 2008 16:57:16 -0000 @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2008 IBM Corporation. All rights reserved. + * Copyright (c) 2006, 2007 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 Index: src/org/eclipse/rse/internal/files/ui/view/SystemRemoteFileSelectionInputProvider.java =================================================================== RCS file: src/org/eclipse/rse/internal/files/ui/view/SystemRemoteFileSelectionInputProvider.java diff -N src/org/eclipse/rse/internal/files/ui/view/SystemRemoteFileSelectionInputProvider.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/rse/internal/files/ui/view/SystemRemoteFileSelectionInputProvider.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,47 @@ +/******************************************************************************* + * 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 + * + * 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 McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types + *******************************************************************************/ + +package org.eclipse.rse.internal.files.ui.view; + +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.internal.ui.view.SystemResourceSelectionInputProvider; +import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; + + +public class SystemRemoteFileSelectionInputProvider extends + SystemResourceSelectionInputProvider +{ + + public SystemRemoteFileSelectionInputProvider(IHost connection) + { + super(connection); + setCategory("files"); //$NON-NLS-1$ + } + + public SystemRemoteFileSelectionInputProvider() + { + super(); + setCategory("files"); //$NON-NLS-1$ + } + + protected ISubSystem getSubSystem(IHost selectedConnection) + { + return RemoteFileUtility.getFileSubSystem(selectedConnection); + } + +}