View | Details | Raw Unified | Return to bug 225506 | Differences between
and this patch

Collapse All | Expand All

(-)UI/org/eclipse/rse/ui/view/SystemResourceSelectionInputProvider.java (-143 lines)
Removed Link Here
1
/********************************************************************************
2
 * Copyright (c) 2004, 2008 IBM Corporation and others. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
7
 * Initial Contributors:
8
 * The following IBM employees contributed to the Remote System Explorer
9
 * component that contains this file: David McKnight, Kushal Munir, 
10
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, 
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * 
13
 * Contributors:
14
 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
15
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
16
 * Martin Oberhuber (Wind River) - [202866] Fix exceptions in RSE browse dialog when SystemRegistry is not yet fully initialized
17
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API types
18
 ********************************************************************************/
19
20
package org.eclipse.rse.ui.view;
21
import org.eclipse.rse.core.IRSESystemType;
22
import org.eclipse.rse.core.RSECorePlugin;
23
import org.eclipse.rse.core.model.IHost;
24
import org.eclipse.rse.core.model.ISystemRegistry;
25
import org.eclipse.rse.core.subsystems.ISubSystem;
26
27
28
public abstract class SystemResourceSelectionInputProvider extends SystemAbstractAPIProvider
29
{		
30
	private IHost _connection = null;
31
	private boolean _onlyConnection = false;
32
	private boolean _allowNew = true;
33
	private IRSESystemType[] _systemTypes;
34
	private String _category = null;
35
	
36
	public SystemResourceSelectionInputProvider(IHost connection)
37
	{
38
		_connection = connection;
39
	}
40
	
41
	public SystemResourceSelectionInputProvider()
42
	{
43
		// choose random host
44
		ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
45
		IHost[] hosts = registry.getHosts();
46
		if (hosts != null && hosts.length>0) {
47
			_connection = hosts[0];
48
		}
49
	}
50
	
51
	public IHost getSystemConnection()
52
	{
53
		return _connection;
54
	}
55
	
56
	public boolean allowMultipleConnections()
57
	{
58
		return !_onlyConnection;
59
	}
60
	
61
	public void setAllowNewConnection(boolean flag)
62
	{
63
		_allowNew = flag;
64
	}
65
	
66
	public boolean allowNewConnection()
67
	{
68
		return _allowNew;
69
	}
70
	
71
	public void setSystemConnection(IHost connection, boolean onlyConnection)
72
	{
73
		_connection = connection;
74
		_onlyConnection = onlyConnection;
75
	}
76
	
77
	public IRSESystemType[] getSystemTypes()
78
	{
79
		return _systemTypes;
80
	}
81
	
82
	public void setSystemTypes(IRSESystemType[] types)
83
	{
84
		_systemTypes = types;
85
	}
86
	
87
	public Object[] getSystemViewRoots()
88
	{
89
		if (_connection == null)
90
		{
91
			ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
92
			IHost[] hosts = registry.getHosts();
93
			if (hosts!=null && hosts.length!=0) {
94
				_connection = registry.getHosts()[0];
95
			}
96
		}
97
		return getConnectionChildren(_connection);
98
	}
99
100
	public boolean hasSystemViewRoots()
101
	{
102
		return false;
103
	}
104
105
	public Object[] getConnectionChildren(IHost selectedConnection)
106
	{
107
		if (selectedConnection != null)
108
		{
109
			ISubSystem ss = getSubSystem(selectedConnection);
110
			if (ss!=null) {
111
				return ss.getChildren();
112
			}
113
		}
114
		return new Object[0];
115
	}
116
117
	public boolean hasConnectionChildren(IHost selectedConnection)
118
	{
119
		if (selectedConnection != null)
120
		{
121
			ISubSystem ss = getSubSystem(selectedConnection);
122
			if (ss!=null) {
123
				return ss.hasChildren();
124
			}
125
		}
126
		return false;
127
	}
128
	
129
	protected abstract ISubSystem getSubSystem(IHost selectedConnection);
130
	
131
	
132
	public void setCategory(String category)
133
	{
134
		_category = category;
135
	}
136
	
137
	public String getCategory()
138
	{
139
		return _category;
140
	}
141
	
142
	
143
}
(-)UI/org/eclipse/rse/ui/view/ISystemSelectRemoteObjectAPIProvider.java (-98 lines)
Removed Link Here
1
/********************************************************************************
2
 * Copyright (c) 2008 IBM Corporation. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
7
 * Initial Contributors:
8
 * The following IBM employees contributed to the Remote System Explorer
9
 * component that contains this file: David McKnight.
10
 * 
11
 * Contributors:
12
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API types
13
 ********************************************************************************/
14
package org.eclipse.rse.ui.view;
15
16
import org.eclipse.rse.core.IRSESystemType;
17
import org.eclipse.rse.core.filters.ISystemFilter;
18
import org.eclipse.rse.core.model.IHost;
19
import org.eclipse.rse.core.model.ISystemViewInputProvider;
20
21
public interface ISystemSelectRemoteObjectAPIProvider 
22
		extends ISystemViewInputProvider
23
{
24
	/**
25
	 * This method is called by the connection adapter when the user expands
26
	 *  a connection. This method must return the child objects to show for that
27
	 *  connection.
28
	 */
29
	public Object[] getConnectionChildren(IHost selectedConnection);
30
	
31
	/**
32
	 * Get the name of the item to select when the first filter is expanded.
33
	 * Called by the filter adapter.
34
	 */
35
	public String getPreSelectFilterChild();
36
	
37
	/**
38
	 * Get the actual object of the item to select when the first filter is expanded.
39
	 * Called by the GUI form after expansion, so it can select this object
40
	 */
41
	public Object getPreSelectFilterChildObject();
42
	
43
	/**
44
	 * Set the filter string to use to resolve the inputs. 
45
	 * If this is an absolute filter string, it gets turned into a quick filter string,
46
	 *  so that the user sees it and can expand it. If it is a relative filter string 
47
	 *  to apply to all expansions, it is used to decorate all filtering as the user drills down.
48
	 */
49
	public void setFilterString(String string);
50
	
51
	/**
52
	 * Set actual child object of the first filter to preselect. Called
53
	 * by the filter adapter once the children are resolved and a match on
54
	 * the name is found.
55
	 */
56
	public void setPreSelectFilterChildObject(Object obj);
57
58
	/**
59
	 * Set child of the first filter to preselect 
60
	 */
61
	public void setPreSelectFilterChild(String name);
62
	
63
	/**
64
	 * Set the quick filters to be exposed to the user. These will be shown to the
65
	 *  user when they expand a connection.
66
	 * @see org.eclipse.rse.core.filters.SystemFilterSimple
67
	 */
68
	public void setQuickFilters(ISystemFilter[] filters);
69
70
	
71
	/**
72
	 * Specify whether the user should see the "New Connection..." special connection prompt
73
	 */
74
	public void setShowNewConnectionPrompt(boolean show);
75
	
76
	
77
	/** 
78
	 * Default or Restrict to a specific connection.
79
	 * If default mode, it is preselected.
80
	 * If only mode, it is the only connection listed.
81
	 * @param connection The connection to default or restrict to
82
	 * @param onlyMode true if this is to be the only connection shown in the list
83
	 */
84
	public void setSystemConnection(IHost connection, boolean onlyMode);
85
86
87
	/**
88
	 * Specify system types to restrict what types of connections
89
	 * the user can create, and see.
90
	 * This will override subsystemConfigurationId,if that has been set!
91
	 * 
92
     * @param systemTypes An array of system types, or
93
     *     <code>null</code> to allow all registered valid system types.
94
     *     A system type is valid if at least one subsystem configuration
95
     *     is registered against it.
96
	 */
97
	public void setSystemTypes(IRSESystemType[] systemTypes);
98
}
(-)UI/org/eclipse/rse/internal/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java (-1 lines)
Lines 35-41 Link Here
35
import org.eclipse.rse.ui.SystemBasePlugin;
35
import org.eclipse.rse.ui.SystemBasePlugin;
36
import org.eclipse.rse.ui.internal.model.SystemNewConnectionPromptObject;
36
import org.eclipse.rse.ui.internal.model.SystemNewConnectionPromptObject;
37
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
37
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
38
import org.eclipse.rse.ui.view.ISystemSelectRemoteObjectAPIProvider;
39
import org.eclipse.rse.ui.view.ISystemSelectRemoteObjectAPIProviderCaller;
38
import org.eclipse.rse.ui.view.ISystemSelectRemoteObjectAPIProviderCaller;
40
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
39
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
41
import org.eclipse.rse.ui.view.SystemAbstractAPIProvider;
40
import org.eclipse.rse.ui.view.SystemAbstractAPIProvider;
(-)UI/org/eclipse/rse/internal/ui/view/SystemResourceSelectionForm.java (-4 / +5 lines)
Lines 44-53 Link Here
44
import org.eclipse.rse.ui.messages.ISystemMessageLine;
44
import org.eclipse.rse.ui.messages.ISystemMessageLine;
45
import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
45
import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
46
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
46
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
47
import org.eclipse.rse.ui.view.ISystemResourceSelectionInputProvider;
47
import org.eclipse.rse.ui.view.ISystemTree;
48
import org.eclipse.rse.ui.view.ISystemTree;
48
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
49
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
49
import org.eclipse.rse.ui.view.SystemAdapterHelpers;
50
import org.eclipse.rse.ui.view.SystemAdapterHelpers;
50
import org.eclipse.rse.ui.view.SystemResourceSelectionInputProvider;
51
import org.eclipse.rse.ui.widgets.SystemHostCombo;
51
import org.eclipse.rse.ui.widgets.SystemHostCombo;
52
import org.eclipse.swt.SWT;
52
import org.eclipse.swt.SWT;
53
import org.eclipse.swt.events.SelectionAdapter;
53
import org.eclipse.swt.events.SelectionAdapter;
Lines 67-74 Link Here
67
	private Shell _shell;
67
	private Shell _shell;
68
	private boolean _multipleSelection = true;
68
	private boolean _multipleSelection = true;
69
	protected static final int PROMPT_WIDTH = 400; // The maximum width of the dialog's prompt, in pixels.
69
	protected static final int PROMPT_WIDTH = 400; // The maximum width of the dialog's prompt, in pixels.
70
	
70
71
	private SystemResourceSelectionInputProvider _inputProvider;
71
	private ISystemResourceSelectionInputProvider _inputProvider;
72
	private SystemHostCombo _connectionCombo;
72
	private SystemHostCombo _connectionCombo;
73
	private SystemViewForm _systemViewForm;
73
	private SystemViewForm _systemViewForm;
74
	private Composite _propertySheetContainer;
74
	private Composite _propertySheetContainer;
Lines 98-104 Link Here
98
	
98
	
99
	
99
	
100
	public SystemResourceSelectionForm(Shell shell, Composite parent, Object caller,
100
	public SystemResourceSelectionForm(Shell shell, Composite parent, Object caller,
101
			SystemResourceSelectionInputProvider inputProvider, String verbiage,
101
			ISystemResourceSelectionInputProvider inputProvider, 
102
			String verbiage,
102
			boolean multipleSelection, 
103
			boolean multipleSelection, 
103
			ISystemMessageLine msgLine)
104
			ISystemMessageLine msgLine)
104
	{
105
	{
(-)UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java (-3 / +4 lines)
Lines 27-34 Link Here
27
import org.eclipse.rse.ui.SystemActionViewerFilter;
27
import org.eclipse.rse.ui.SystemActionViewerFilter;
28
import org.eclipse.rse.ui.messages.ISystemMessageLine;
28
import org.eclipse.rse.ui.messages.ISystemMessageLine;
29
import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
29
import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
30
import org.eclipse.rse.ui.view.ISystemResourceSelectionInputProvider;
30
import org.eclipse.rse.ui.view.ISystemTree;
31
import org.eclipse.rse.ui.view.ISystemTree;
31
import org.eclipse.rse.ui.view.SystemResourceSelectionInputProvider;
32
import org.eclipse.swt.widgets.Composite;
32
import org.eclipse.swt.widgets.Composite;
33
import org.eclipse.swt.widgets.Control;
33
import org.eclipse.swt.widgets.Control;
34
import org.eclipse.swt.widgets.Shell;
34
import org.eclipse.swt.widgets.Shell;
Lines 37-43 Link Here
37
public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
37
public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
38
{
38
{
39
	private SystemResourceSelectionForm	_form;
39
	private SystemResourceSelectionForm	_form;
40
	private SystemResourceSelectionInputProvider _inputProvider;
40
	private ISystemResourceSelectionInputProvider _inputProvider;
41
	private Object _preSelection;
41
	private Object _preSelection;
42
	private IValidatorRemoteSelection _selectionValidator;
42
	private IValidatorRemoteSelection _selectionValidator;
43
	private boolean _multipleSelectionMode;
43
	private boolean _multipleSelectionMode;
Lines 47-53 Link Here
47
	private String _message, _tip;
47
	private String _message, _tip;
48
	
48
	
49
49
50
	public SystemRemoteResourceDialog(Shell shell, String title, SystemResourceSelectionInputProvider inputProvider)
50
	public SystemRemoteResourceDialog(Shell shell, String title, 
51
			ISystemResourceSelectionInputProvider inputProvider)
51
	{
52
	{
52
		super(shell, title);
53
		super(shell, title);
53
		_inputProvider = inputProvider;
54
		_inputProvider = inputProvider;
(-)UI/org/eclipse/rse/ui/view/ISystemResourceSelectionInputProvider.java (+80 lines)
Added Link Here
1
/********************************************************************************
2
 * Copyright (c) 2008 IBM Corporation. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
7
 * Initial Contributors:
8
 * The following IBM employees contributed to the Remote System Explorer
9
 * component that contains this file: David McKnight.
10
 * 
11
 * Contributors:
12
 *  David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API types
13
 ********************************************************************************/
14
package org.eclipse.rse.ui.view;
15
16
import org.eclipse.rse.core.IRSESystemType;
17
import org.eclipse.rse.core.model.IHost;
18
import org.eclipse.rse.core.model.ISystemViewInputProvider;
19
20
/**
21
 * Public interface for the system resource selection input provider
22
 * that is used in the SystemRemoteResourceDialog and the 
23
 * SystemResourceSelectionForm
24
 *
25
 */
26
public interface ISystemResourceSelectionInputProvider 
27
  extends ISystemViewInputProvider
28
{
29
	/**
30
	 * Gets the associated system connection
31
	 * @return the system connection
32
	 */
33
	public IHost getSystemConnection();
34
	
35
	/**
36
	 * Indicates whether the input provider should allow new connections
37
	 * to be created.
38
	 * @param flag whether new connections should be allowed
39
	 */
40
	public void setAllowNewConnection(boolean flag);
41
42
	/**
43
	 * Returns whether multiple connections can be displayed via the 
44
	 * input provider
45
	 * @return true if multiple connections are allowed
46
	 */
47
	public boolean allowMultipleConnections();
48
	
49
	/**
50
	 * Returns whether new connections can be created from the view
51
	 * using this input provider.
52
	 * @return true if new connections are allowed.
53
	 */
54
	public boolean allowNewConnection();
55
		
56
	/**
57
	 * Returns the category for the view using the input provider (i.e. "files")
58
	 * @return the category
59
	 */
60
	public String getCategory();
61
	
62
	/**
63
	 * Sets the system types allowed for this input provider
64
	 * @param types the types of systems
65
	 */
66
	public void setSystemTypes(IRSESystemType[] types);
67
68
	/**
69
	 * Gets the system types allowed for the associated control
70
	 * @return the system types
71
	 */
72
	public IRSESystemType[] getSystemTypes();
73
	
74
	/**
75
	 * Sets the associated system connection for the input provider
76
	 * @param connection the connection
77
	 * @param onlyConnection whether other connections are allowed
78
	 */
79
	public void setSystemConnection(IHost connection, boolean onlyConnection);
80
}
(-)UI/org/eclipse/rse/internal/ui/view/ISystemSelectRemoteObjectAPIProvider.java (+98 lines)
Added Link Here
1
/********************************************************************************
2
 * Copyright (c) 2008 IBM Corporation. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
7
 * Initial Contributors:
8
 * The following IBM employees contributed to the Remote System Explorer
9
 * component that contains this file: David McKnight.
10
 * 
11
 * Contributors:
12
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API types
13
 ********************************************************************************/
14
package org.eclipse.rse.internal.ui.view;
15
16
import org.eclipse.rse.core.IRSESystemType;
17
import org.eclipse.rse.core.filters.ISystemFilter;
18
import org.eclipse.rse.core.model.IHost;
19
import org.eclipse.rse.core.model.ISystemViewInputProvider;
20
21
public interface ISystemSelectRemoteObjectAPIProvider 
22
		extends ISystemViewInputProvider
23
{
24
	/**
25
	 * This method is called by the connection adapter when the user expands
26
	 *  a connection. This method must return the child objects to show for that
27
	 *  connection.
28
	 */
29
	public Object[] getConnectionChildren(IHost selectedConnection);
30
	
31
	/**
32
	 * Get the name of the item to select when the first filter is expanded.
33
	 * Called by the filter adapter.
34
	 */
35
	public String getPreSelectFilterChild();
36
	
37
	/**
38
	 * Get the actual object of the item to select when the first filter is expanded.
39
	 * Called by the GUI form after expansion, so it can select this object
40
	 */
41
	public Object getPreSelectFilterChildObject();
42
	
43
	/**
44
	 * Set the filter string to use to resolve the inputs. 
45
	 * If this is an absolute filter string, it gets turned into a quick filter string,
46
	 *  so that the user sees it and can expand it. If it is a relative filter string 
47
	 *  to apply to all expansions, it is used to decorate all filtering as the user drills down.
48
	 */
49
	public void setFilterString(String string);
50
	
51
	/**
52
	 * Set actual child object of the first filter to preselect. Called
53
	 * by the filter adapter once the children are resolved and a match on
54
	 * the name is found.
55
	 */
56
	public void setPreSelectFilterChildObject(Object obj);
57
58
	/**
59
	 * Set child of the first filter to preselect 
60
	 */
61
	public void setPreSelectFilterChild(String name);
62
	
63
	/**
64
	 * Set the quick filters to be exposed to the user. These will be shown to the
65
	 *  user when they expand a connection.
66
	 * @see org.eclipse.rse.core.filters.SystemFilterSimple
67
	 */
68
	public void setQuickFilters(ISystemFilter[] filters);
69
70
	
71
	/**
72
	 * Specify whether the user should see the "New Connection..." special connection prompt
73
	 */
74
	public void setShowNewConnectionPrompt(boolean show);
75
	
76
	
77
	/** 
78
	 * Default or Restrict to a specific connection.
79
	 * If default mode, it is preselected.
80
	 * If only mode, it is the only connection listed.
81
	 * @param connection The connection to default or restrict to
82
	 * @param onlyMode true if this is to be the only connection shown in the list
83
	 */
84
	public void setSystemConnection(IHost connection, boolean onlyMode);
85
86
87
	/**
88
	 * Specify system types to restrict what types of connections
89
	 * the user can create, and see.
90
	 * This will override subsystemConfigurationId,if that has been set!
91
	 * 
92
     * @param systemTypes An array of system types, or
93
     *     <code>null</code> to allow all registered valid system types.
94
     *     A system type is valid if at least one subsystem configuration
95
     *     is registered against it.
96
	 */
97
	public void setSystemTypes(IRSESystemType[] systemTypes);
98
}
(-)UI/org/eclipse/rse/internal/ui/view/SystemResourceSelectionInputProvider.java (+146 lines)
Added Link Here
1
/********************************************************************************
2
 * Copyright (c) 2004, 2008 IBM Corporation and others. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
7
 * Initial Contributors:
8
 * The following IBM employees contributed to the Remote System Explorer
9
 * component that contains this file: David McKnight, Kushal Munir, 
10
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, 
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * 
13
 * Contributors:
14
 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
15
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
16
 * Martin Oberhuber (Wind River) - [202866] Fix exceptions in RSE browse dialog when SystemRegistry is not yet fully initialized
17
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API types
18
 ********************************************************************************/
19
20
package org.eclipse.rse.internal.ui.view;
21
import org.eclipse.rse.core.IRSESystemType;
22
import org.eclipse.rse.core.RSECorePlugin;
23
import org.eclipse.rse.core.model.IHost;
24
import org.eclipse.rse.core.model.ISystemRegistry;
25
import org.eclipse.rse.core.subsystems.ISubSystem;
26
import org.eclipse.rse.ui.view.ISystemResourceSelectionInputProvider;
27
import org.eclipse.rse.ui.view.SystemAbstractAPIProvider;
28
29
30
public abstract class SystemResourceSelectionInputProvider extends SystemAbstractAPIProvider
31
	implements ISystemResourceSelectionInputProvider
32
{		
33
	private IHost _connection = null;
34
	private boolean _onlyConnection = false;
35
	private boolean _allowNew = true;
36
	private IRSESystemType[] _systemTypes;
37
	private String _category = null;
38
	
39
	public SystemResourceSelectionInputProvider(IHost connection)
40
	{
41
		_connection = connection;
42
	}
43
	
44
	public SystemResourceSelectionInputProvider()
45
	{
46
		// choose random host
47
		ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
48
		IHost[] hosts = registry.getHosts();
49
		if (hosts != null && hosts.length>0) {
50
			_connection = hosts[0];
51
		}
52
	}
53
	
54
	public IHost getSystemConnection()
55
	{
56
		return _connection;
57
	}
58
	
59
	public boolean allowMultipleConnections()
60
	{
61
		return !_onlyConnection;
62
	}
63
	
64
	public void setAllowNewConnection(boolean flag)
65
	{
66
		_allowNew = flag;
67
	}
68
	
69
	public boolean allowNewConnection()
70
	{
71
		return _allowNew;
72
	}
73
	
74
	public void setSystemConnection(IHost connection, boolean onlyConnection)
75
	{
76
		_connection = connection;
77
		_onlyConnection = onlyConnection;
78
	}
79
	
80
	public IRSESystemType[] getSystemTypes()
81
	{
82
		return _systemTypes;
83
	}
84
	
85
	public void setSystemTypes(IRSESystemType[] types)
86
	{
87
		_systemTypes = types;
88
	}
89
	
90
	public Object[] getSystemViewRoots()
91
	{
92
		if (_connection == null)
93
		{
94
			ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
95
			IHost[] hosts = registry.getHosts();
96
			if (hosts!=null && hosts.length!=0) {
97
				_connection = registry.getHosts()[0];
98
			}
99
		}
100
		return getConnectionChildren(_connection);
101
	}
102
103
	public boolean hasSystemViewRoots()
104
	{
105
		return false;
106
	}
107
108
	public Object[] getConnectionChildren(IHost selectedConnection)
109
	{
110
		if (selectedConnection != null)
111
		{
112
			ISubSystem ss = getSubSystem(selectedConnection);
113
			if (ss!=null) {
114
				return ss.getChildren();
115
			}
116
		}
117
		return new Object[0];
118
	}
119
120
	public boolean hasConnectionChildren(IHost selectedConnection)
121
	{
122
		if (selectedConnection != null)
123
		{
124
			ISubSystem ss = getSubSystem(selectedConnection);
125
			if (ss!=null) {
126
				return ss.hasChildren();
127
			}
128
		}
129
		return false;
130
	}
131
	
132
	protected abstract ISubSystem getSubSystem(IHost selectedConnection);
133
	
134
	
135
	public void setCategory(String category)
136
	{
137
		_category = category;
138
	}
139
	
140
	public String getCategory()
141
	{
142
		return _category;
143
	}
144
	
145
	
146
}
(-)src/org/eclipse/rse/files/ui/widgets/SystemSelectRemoteFileOrFolderForm.java (-2 / +2 lines)
Lines 38-43 Link Here
38
import org.eclipse.rse.core.model.ISystemRegistry;
38
import org.eclipse.rse.core.model.ISystemRegistry;
39
import org.eclipse.rse.files.ui.ISystemAddFileListener;
39
import org.eclipse.rse.files.ui.ISystemAddFileListener;
40
import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources;
40
import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources;
41
import org.eclipse.rse.internal.ui.view.ISystemSelectRemoteObjectAPIProvider;
41
import org.eclipse.rse.internal.ui.view.SystemPropertySheetForm;
42
import org.eclipse.rse.internal.ui.view.SystemPropertySheetForm;
42
import org.eclipse.rse.internal.ui.view.SystemSelectRemoteObjectAPIProviderImpl;
43
import org.eclipse.rse.internal.ui.view.SystemSelectRemoteObjectAPIProviderImpl;
43
import org.eclipse.rse.internal.ui.view.SystemViewForm;
44
import org.eclipse.rse.internal.ui.view.SystemViewForm;
Lines 55-61 Link Here
55
import org.eclipse.rse.ui.messages.ISystemMessageLine;
56
import org.eclipse.rse.ui.messages.ISystemMessageLine;
56
import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
57
import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
57
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
58
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
58
import org.eclipse.rse.ui.view.ISystemSelectRemoteObjectAPIProvider;
59
import org.eclipse.rse.ui.view.ISystemTree;
59
import org.eclipse.rse.ui.view.ISystemTree;
60
import org.eclipse.rse.ui.view.SystemAdapterHelpers;
60
import org.eclipse.rse.ui.view.SystemAdapterHelpers;
61
import org.eclipse.swt.SWT;
61
import org.eclipse.swt.SWT;
Lines 198-204 Link Here
198
	 * Returns the input provider that drives the contents of the tree
198
	 * Returns the input provider that drives the contents of the tree
199
	 * Subclasses can override to provide custom tree contents
199
	 * Subclasses can override to provide custom tree contents
200
	 */
200
	 */
201
	protected ISystemSelectRemoteObjectAPIProvider getInputProvider()
201
	private ISystemSelectRemoteObjectAPIProvider getInputProvider()
202
	{
202
	{
203
		if (inputProvider == null)
203
		if (inputProvider == null)
204
		{
204
		{
(-)src/org/eclipse/rse/files/ui/dialogs/SystemRemoteFileSelectionInputProvider.java (-47 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Initial Contributors:
9
 * The following IBM employees contributed to the Remote System Explorer
10
 * component that contains this file: David McKnight, Kushal Munir, 
11
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, 
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
13
 * 
14
 * Contributors:
15
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API types
16
 *******************************************************************************/
17
18
package org.eclipse.rse.files.ui.dialogs;
19
20
import org.eclipse.rse.core.model.IHost;
21
import org.eclipse.rse.core.subsystems.ISubSystem;
22
import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
23
import org.eclipse.rse.ui.view.SystemResourceSelectionInputProvider;
24
25
26
public class SystemRemoteFileSelectionInputProvider extends
27
		SystemResourceSelectionInputProvider
28
{
29
30
	public SystemRemoteFileSelectionInputProvider(IHost connection)
31
	{
32
		super(connection);
33
		setCategory("files"); //$NON-NLS-1$
34
	}
35
	
36
	public SystemRemoteFileSelectionInputProvider()
37
	{
38
		super();
39
		setCategory("files"); //$NON-NLS-1$
40
	}
41
42
	protected ISubSystem getSubSystem(IHost selectedConnection)
43
	{
44
		return RemoteFileUtility.getFileSubSystem(selectedConnection);
45
	}
46
47
}
(-)src/org/eclipse/rse/files/ui/dialogs/SystemRemoteFileDialog.java (+1 lines)
Lines 23-28 Link Here
23
import org.eclipse.jface.viewers.IDoubleClickListener;
23
import org.eclipse.jface.viewers.IDoubleClickListener;
24
import org.eclipse.jface.viewers.IStructuredSelection;
24
import org.eclipse.jface.viewers.IStructuredSelection;
25
import org.eclipse.rse.core.model.IHost;
25
import org.eclipse.rse.core.model.IHost;
26
import org.eclipse.rse.internal.files.ui.view.SystemRemoteFileSelectionInputProvider;
26
import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources;
27
import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources;
27
import org.eclipse.rse.ui.SystemActionViewerFilter;
28
import org.eclipse.rse.ui.SystemActionViewerFilter;
28
import org.eclipse.rse.ui.dialogs.SystemRemoteResourceDialog;
29
import org.eclipse.rse.ui.dialogs.SystemRemoteResourceDialog;
(-)src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderForm.java (-1 / +1 lines)
Lines 11-19 Link Here
11
package org.eclipse.rse.internal.files.ui.search;
11
package org.eclipse.rse.internal.files.ui.search;
12
12
13
import org.eclipse.rse.files.ui.widgets.SystemSelectRemoteFileOrFolderForm;
13
import org.eclipse.rse.files.ui.widgets.SystemSelectRemoteFileOrFolderForm;
14
import org.eclipse.rse.internal.ui.view.ISystemSelectRemoteObjectAPIProvider;
14
import org.eclipse.rse.subsystems.files.core.model.ISystemFileRemoteTypes;
15
import org.eclipse.rse.subsystems.files.core.model.ISystemFileRemoteTypes;
15
import org.eclipse.rse.ui.messages.ISystemMessageLine;
16
import org.eclipse.rse.ui.messages.ISystemMessageLine;
16
import org.eclipse.rse.ui.view.ISystemSelectRemoteObjectAPIProvider;
17
17
18
/**
18
/**
19
 * The selection form to use is search selection dialogs.
19
 * The selection form to use is search selection dialogs.
(-)src/org/eclipse/rse/internal/files/ui/view/SystemRemoteFileSelectionInputProvider.java (+47 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Initial Contributors:
9
 * The following IBM employees contributed to the Remote System Explorer
10
 * component that contains this file: David McKnight, Kushal Munir, 
11
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, 
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
13
 * 
14
 * Contributors:
15
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API types
16
 *******************************************************************************/
17
18
package org.eclipse.rse.internal.files.ui.view;
19
20
import org.eclipse.rse.core.model.IHost;
21
import org.eclipse.rse.core.subsystems.ISubSystem;
22
import org.eclipse.rse.internal.ui.view.SystemResourceSelectionInputProvider;
23
import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
24
25
26
public class SystemRemoteFileSelectionInputProvider extends
27
		SystemResourceSelectionInputProvider
28
{
29
30
	public SystemRemoteFileSelectionInputProvider(IHost connection)
31
	{
32
		super(connection);
33
		setCategory("files"); //$NON-NLS-1$
34
	}
35
	
36
	public SystemRemoteFileSelectionInputProvider()
37
	{
38
		super();
39
		setCategory("files"); //$NON-NLS-1$
40
	}
41
42
	protected ISubSystem getSubSystem(IHost selectedConnection)
43
	{
44
		return RemoteFileUtility.getFileSubSystem(selectedConnection);
45
	}
46
47
}

Return to bug 225506